Created
March 18, 2021 13:41
-
-
Save umezawatakeshi/044aab7d929e75340312be112ac588b1 to your computer and use it in GitHub Desktop.
Golang template テスト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m := map[string]string{ | |
"a": "z", | |
"b": "", | |
} | |
t.Execute(os.Stdout, m) | |
go run . '{{ $x := "hoge\n" }}{{ $x }},{{ .a }} {{ if .b }}{{.b}}{{else}}b is false value{{end}}{{ "\n" }}' | |
hoge | |
,z b is false value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment