Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
dc6f8321
Commit
dc6f8321
authored
Mar 28, 2010
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: add HandleFunc as shortcut to Handle(path, HandlerFunc(func))
R=rsc CC=golang-dev
https://golang.org/cl/763042
parent
66dd26e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
server.go
src/pkg/http/server.go
+11
-0
No files found.
src/pkg/http/server.go
View file @
dc6f8321
...
...
@@ -524,10 +524,21 @@ func (mux *ServeMux) Handle(pattern string, handler Handler) {
}
}
// HandleFunc registers the handler function for the given pattern.
func
(
mux
*
ServeMux
)
HandleFunc
(
pattern
string
,
handler
func
(
*
Conn
,
*
Request
))
{
mux
.
Handle
(
pattern
,
HandlerFunc
(
handler
))
}
// Handle registers the handler for the given pattern
// in the DefaultServeMux.
func
Handle
(
pattern
string
,
handler
Handler
)
{
DefaultServeMux
.
Handle
(
pattern
,
handler
)
}
// HandleFunc registers the handler function for the given pattern
// in the DefaultServeMux.
func
HandleFunc
(
pattern
string
,
handler
func
(
*
Conn
,
*
Request
))
{
DefaultServeMux
.
HandleFunc
(
pattern
,
handler
)
}
// Serve accepts incoming HTTP connections on the listener l,
// creating a new service thread for each. The service threads
// read requests and then call handler to reply to them.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment