hugolib: Only run variable variable overwrite test on Go 1.11

This commit is contained in:
Bjørn Erik Pedersen 2018-08-28 17:57:42 +02:00
parent 0c8a415483
commit 6022f219f1
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 8 additions and 1 deletions

View file

@ -257,7 +257,10 @@ T2: Content: {{ $combinedText.Content }}|{{ $combinedText.RelPermalink }}
b.AssertFileContent("public/rocks/hugo.txt", "Hugo Rocks!") b.AssertFileContent("public/rocks/hugo.txt", "Hugo Rocks!")
}}, }},
{"execute-as-template", func() bool { return true }, func(b *sitesBuilder) { {"execute-as-template", func() bool {
// TODO(bep) eventually remove
return isGo111()
}, func(b *sitesBuilder) {
b.WithTemplates("home.html", ` b.WithTemplates("home.html", `
{{ $var := "Hugo Page" }} {{ $var := "Hugo Page" }}
{{ if .IsHome }} {{ if .IsHome }}

View file

@ -676,3 +676,7 @@ func dumpPages(pages ...*Page) {
func isCI() bool { func isCI() bool {
return os.Getenv("CI") != "" return os.Getenv("CI") != ""
} }
func isGo111() bool {
return strings.Contains(runtime.Version(), "1.11")
}