Commit 95741ff4 authored by Gabriel Monnerat's avatar Gabriel Monnerat Committed by Kirill Smelkov

helloword.go: Use default go format

'go fmt' is your friend

https://blog.golang.org/go-fmt-your-code

Keep the same format is good to share and maintain code
parent 0487fa7b
...@@ -4,22 +4,20 @@ ...@@ -4,22 +4,20 @@
package main package main
import ( import (
"os" "flag"
"fmt" "fmt"
"time"
"log" "log"
"flag"
"strings"
"net" "net"
"net/http" "net/http"
"os"
"strings"
"time"
) )
func asctime() string { func asctime() string {
return time.Now().Format(time.ANSIC) return time.Now().Format(time.ANSIC)
} }
// wrapper for http.Handler to log all requests // wrapper for http.Handler to log all requests
func logit(handler http.Handler) http.Handler { func logit(handler http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
...@@ -28,8 +26,6 @@ func logit(handler http.Handler) http.Handler { ...@@ -28,8 +26,6 @@ func logit(handler http.Handler) http.Handler {
}) })
} }
var name string var name string
func webhello(w http.ResponseWriter, r *http.Request) { func webhello(w http.ResponseWriter, r *http.Request) {
...@@ -61,7 +57,7 @@ func main() { ...@@ -61,7 +57,7 @@ func main() {
// redirect log to file, if requested // redirect log to file, if requested
if *logfile != "" { if *logfile != "" {
f, err := os.OpenFile(*logfile, os.O_RDWR | os.O_CREATE | os.O_APPEND, 0644) f, err := os.OpenFile(*logfile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
if err != nil { if err != nil {
panic(err) panic(err)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment