Remove builds conditional on go1.7 since that is now guaranteed #2154
Old fallback code was deleted and the go1.7 style code inlined where appropriate.
This commit is contained in:
parent
e5be471ce0
commit
be54fd8f70
35 changed files with 45 additions and 157 deletions
|
@ -9,6 +9,7 @@ package rc
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
|
@ -66,6 +67,13 @@ func (s *server) serve() {
|
|||
s.srv.Wait()
|
||||
}
|
||||
|
||||
// WriteJSON writes JSON in out to w
|
||||
func WriteJSON(w io.Writer, out Params) error {
|
||||
enc := json.NewEncoder(w)
|
||||
enc.SetIndent("", "\t")
|
||||
return enc.Encode(out)
|
||||
}
|
||||
|
||||
// handler reads incoming requests and dispatches them
|
||||
func (s *server) handler(w http.ResponseWriter, r *http.Request) {
|
||||
path := strings.Trim(r.URL.Path, "/")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue