Skip to content

Commit cc94831

Browse files
committed
refactor: google example
1 parent 0ff7b85 commit cc94831

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Diff for: examples/google.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package main
22

33
import (
4-
"fmt"
54
"log"
65
"net/http"
76
"os"
@@ -34,7 +33,7 @@ func main() {
3433
log.Println("user: ", u)
3534

3635
// and tell the user it is all good:
37-
_, _ = fmt.Fprintf(w, "All good, check backend console")
36+
_, _ = w.Write([]byte("All good, check backend console"))
3837
})
3938

4039
// Listen address for server, 443 for https as OpenID connect mandates it!
@@ -45,11 +44,11 @@ func main() {
4544

4645
// A catch-all dummy handler
4746
handler := func(w http.ResponseWriter, r *http.Request) {
48-
_, _ = fmt.Fprintf(w, r.Method+" "+r.URL.Path+"\n")
47+
_, _ = w.Write([]byte(r.Method + " " + r.URL.Path))
4948
}
5049

51-
fmt.Println("Server running on https://localhost")
52-
fmt.Println(" Visit https://localhost/auth/o8/google")
50+
log.Println("Server running on https://localhost")
51+
log.Println(" Visit https://localhost/auth/o8/google")
5352

5453
// This is just example (don't copy it)
5554
useMux := os.Getenv("GOIC_HTTP_MUX") == "1"

0 commit comments

Comments
 (0)