Last active
September 29, 2020 02:31
-
-
Save shin1x1/4347a390a7d7a47abc946257cb9e618c to your computer and use it in GitHub Desktop.
hello-server
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 ( | |
"io" | |
"log" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
io.WriteString(w, "Hello\n") | |
}) | |
log.Fatal(http.ListenAndServe(":8000", nil)) | |
} |
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
hello-server: | |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 docker run --rm -v `pwd`:/app -w /app golang:1.15-buster go build -o hello-server | |
clean: | |
-rm hello-server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment