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
a267ff6a
Commit
a267ff6a
authored
Apr 05, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: fix documentation example
R=adg CC=golang-dev
https://golang.org/cl/813043
parent
edcd70e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/pkg/http/server.go
src/pkg/http/server.go
+7
-6
No files found.
src/pkg/http/server.go
View file @
a267ff6a
...
...
@@ -571,20 +571,21 @@ func Serve(l net.Listener, handler Handler) os.Error {
// package main
//
// import (
// "http";
// "io";
// "http"
// "io"
// "log"
// )
//
// // hello world, the web server
// func HelloServer(c *http.Conn, req *http.Request) {
// io.WriteString(c, "hello, world!\n")
;
// io.WriteString(c, "hello, world!\n")
// }
//
// func main() {
// http.Handle
("/hello", http.HandlerFunc(HelloServer));
// err := http.ListenAndServe(":12345", nil)
;
// http.Handle
Func("/hello", HelloServer)
// err := http.ListenAndServe(":12345", nil)
// if err != nil {
//
panic
("ListenAndServe: ", err.String())
//
log.Exit
("ListenAndServe: ", err.String())
// }
// }
func
ListenAndServe
(
addr
string
,
handler
Handler
)
os
.
Error
{
...
...
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