package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net" "net/http" ) type Input struct { Foo string `json:"foo"` Bar string `json:"bar"` } type Output struct { Message string `json:"message"` } func main() { // ダミーのHTTPサーバを立ち上げる listener, err := net.Listen("tcp", ":9999") if err != nil { return } defer listener.Close() http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request)