15 lines
223 B
Go
15 lines
223 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"io"
|
||
|
"net/http"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func (s *server) handleTime() http.HandlerFunc {
|
||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||
|
w.WriteHeader(200)
|
||
|
io.WriteString(w, time.Now().String())
|
||
|
}
|
||
|
}
|