2016-09-16から1日間の記事一覧

goのtext/templateでprivateなattributeを出力しようとするとエラーになるという話

goのtext/templateでprivateなattributeを出力しようとすると、エラーになるという話を知らなかった。 全部public 例えば、以下はOK type User struct { Name string Message string } type V map[string]interface{} func main() { const tmpl = `{{.user.N…