Created
September 16, 2010 13:36
-
-
Save dimavs/582432 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "runtime"; | |
import "http"; | |
import "io"; | |
func HelloServer(c *http.Conn, req *http.Request) { | |
io.WriteString(c, "hello, world!\n"); | |
} | |
func main() { | |
runtime.GOMAXPROCS(2); // dual core | |
http.Handle("/", http.HandlerFunc(HelloServer)); | |
http.ListenAndServe(":8080", nil); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment