2020-07-12から1日間の記事一覧
Golangでjsonデータをhttpで表示する json.NewEncoder を使う.ファイルに書き込むときと同じようにio.Writer interfaceをもつhttp.ResponseWriterを引数にする. package main import ( "encoding/json" "net/http" "os" ) func handler(w http.ResponseWrite…
Golangでjsonデータをhttpで表示する json.NewEncoder を使う.ファイルに書き込むときと同じようにio.Writer interfaceをもつhttp.ResponseWriterを引数にする. package main import ( "encoding/json" "net/http" "os" ) func handler(w http.ResponseWrite…