Skip to content

Commit 6e587a8

Browse files
committed
Rename 'web.Handler' to 'web.Handle'
Most other functions in `web` are in the imperative tense. Rename `Handler` to `Handle` for consistency. Perform a similar rename for the 'Server' type. Also, simplify the comment a bit.
1 parent 454e24c commit 6e587a8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ func (s *Server) Match(method string, route string, handler interface{}) {
123123
s.addRoute(route, method, handler)
124124
}
125125

126-
//Adds a custom handler. Only for webserver mode. Will have no effect when running as FCGI or SCGI.
127-
func (s *Server) Handler(route string, method string, httpHandler http.Handler) {
126+
// Add a custom http.Handler. Will have no effect when running as FCGI or SCGI.
127+
func (s *Server) Handle(route string, method string, httpHandler http.Handler) {
128128
s.addRoute(route, method, httpHandler)
129129
}
130130

web.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ func Match(method string, route string, handler interface{}) {
250250
mainServer.addRoute(route, method, handler)
251251
}
252252

253-
//Adds a custom handler. Only for webserver mode. Will have no effect when running as FCGI or SCGI.
254-
func Handler(route string, method string, httpHandler http.Handler) {
255-
mainServer.Handler(route, method, httpHandler)
253+
// Add a custom HTTP handler for a path. This will have no effect when running as FCGI or SCGI.
254+
func Handle(route string, method string, httpHandler http.Handler) {
255+
mainServer.Handle(route, method, httpHandler)
256256
}
257257

258258
//Adds a handler for websockets. Only for webserver mode. Will have no effect when running as FCGI or SCGI.

0 commit comments

Comments
 (0)