Created
April 25, 2022 03:29
-
-
Save khannedy/9262c7784a9ef65ced9dac712822a853 to your computer and use it in GitHub Desktop.
Golang Web Hello World
This file contains hidden or 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 ( | |
"fmt" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", HelloServer) | |
http.ListenAndServe(":8080", nil) | |
} | |
func HelloServer(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "Hello, World!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment