Skip to content

Instantly share code, notes, and snippets.

@shin1x1
Last active September 29, 2020 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shin1x1/4347a390a7d7a47abc946257cb9e618c to your computer and use it in GitHub Desktop.
Save shin1x1/4347a390a7d7a47abc946257cb9e618c to your computer and use it in GitHub Desktop.
hello-server
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))
}
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