Skip to content

Instantly share code, notes, and snippets.

@aoisensi
Created May 11, 2022 14:20
Show Gist options
  • Save aoisensi/45603cf7b7b330e94bf432f9794d492f to your computer and use it in GitHub Desktop.
Save aoisensi/45603cf7b7b330e94bf432f9794d492f to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"strconv"
)
var counter int
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
counter++
w.Write([]byte("あなたは" + strconv.Itoa(counter) + "人目の訪問者です"))
})
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment