diff options
| author | Robert Griesemer <gri@golang.org> | 2009-11-06 14:24:38 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2009-11-06 14:24:38 -0800 |
| commit | 828334dd95ce8e4bf3662bd5c89d7c417f0741d0 (patch) | |
| tree | fd7e0c9961bc3af2ddf105e9cc1943f2509ac584 /src/pkg/http/server.go | |
| parent | eb5cdfd67ff6d32df4c4c27840eaee027c5e3512 (diff) | |
| download | golang-828334dd95ce8e4bf3662bd5c89d7c417f0741d0.tar.gz | |
- fine-tuning of one-line func heuristic (nodes.go)
- enabled for function declarations (not just function literals)
- applied gofmt -w $GOROOT/src
(look for instance at src/pkg/debug/elf/elf.go)
R=r, rsc
CC=go-dev
http://go/go-review/1026006
Diffstat (limited to 'src/pkg/http/server.go')
| -rw-r--r-- | src/pkg/http/server.go | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/pkg/http/server.go b/src/pkg/http/server.go index 3aa5c072f..4b4c5837a 100644 --- a/src/pkg/http/server.go +++ b/src/pkg/http/server.go @@ -115,9 +115,7 @@ func (c *Conn) readRequest() (req *Request, err os.Error) { // Content-Type in this library, so users need not make that // particular call. Calls to SetHeader after WriteHeader (or Write) // are ignored. -func (c *Conn) SetHeader(hdr, val string) { - c.header[CanonicalHeaderKey(hdr)] = val; -} +func (c *Conn) SetHeader(hdr, val string) { c.header[CanonicalHeaderKey(hdr)] = val } // WriteHeader sends an HTTP response header with status code. // If WriteHeader is not called explicitly, the first call to Write @@ -326,9 +324,7 @@ func NotFound(c *Conn, req *Request) { // NotFoundHandler returns a simple request handler // that replies to each request with a ``404 page not found'' reply. -func NotFoundHandler() Handler { - return HandlerFunc(NotFound); -} +func NotFoundHandler() Handler { return HandlerFunc(NotFound) } // Redirect replies to the request with a redirect to url, // which may be a path relative to the request path. @@ -433,9 +429,7 @@ type ServeMux struct { } // NewServeMux allocates and returns a new ServeMux. -func NewServeMux() *ServeMux { - return &ServeMux{make(map[string]Handler)}; -} +func NewServeMux() *ServeMux { return &ServeMux{make(map[string]Handler)} } // DefaultServeMux is the default ServeMux used by Serve. var DefaultServeMux = NewServeMux() @@ -516,9 +510,7 @@ func (mux *ServeMux) Handle(pattern string, handler Handler) { // Handle registers the handler for the given pattern // in the DefaultServeMux. -func Handle(pattern string, handler Handler) { - DefaultServeMux.Handle(pattern, handler); -} +func Handle(pattern string, handler Handler) { DefaultServeMux.Handle(pattern, handler) } // Serve accepts incoming HTTP connections on the listener l, // creating a new service thread for each. The service threads |
