Description
What version of Go are you using (go version
)?
go version go1.10.3 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env
)?
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
Bug exists when program built as:
env GOOS=linux GOARCH=386 go build
AND
env GOOS=linux GOARCH=386 GO386=387 go build
AND when run in GoPlayground
It works correct in amd64 architecture environment.
What did you do?
I'm trying to compare time.Duration variable with the constant in text/template.
Variable:
duration := 10*time.Minute
Template:
{{if gt . 60000000000}}true{{else}}false{{end}}
If the code is build for 386 architecture it fails with run-time error:
template: :1:10: executing "" at <60000000000>: 60000000000 overflows int
It fails in GoPlayground too:
https://play.golang.org/p/frPKxFsZKE6
What did you expect to see?
template engine should properly evaluate constants like 60000000000 for 386 builds
What did you see instead?
60000000000 overflows int