Go言語 Echoサーバーでテンプレートエンジンを試してみる。

ほぼサンプルどうり簡単につくってみる。

対象となるファイルを起動時に読み込む。

public/views/*.html

render時の引数で、そのファイル名を指定する。

return c.Render(http.StatusOK, "hello", "world")

全体サンプル gist.github.com

fasthttp - GoDoc

次回、pongo2使ってみよう。

github.com