フロントエンドエンジニアをやっています。
頑張るから読んでほしい。

2018-05-25から1日間の記事一覧

Go言語でhttpサーバーを立ち上げる

Go言語でHTTP通信をするには、net/httpパッケージを使用します。 package main import ( "io" "net/http" ) func infoHandler(w http.ResponseWriter, r *http.Request) { // HTML テキストをhttp.ResponseWriteへ io.WriteString(w, ` <html lang="ja"> <head> <meta charset="UTF-8"> <title>hello</title> </head> <body> <h1>Hello W…</h1></body></html>