Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
dc6f8321
Commit
dc6f8321
authored
Mar 29, 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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
src/pkg/http/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