hako / durafmt

:clock8: Better time duration formatting in Go!
MIT License
496 stars 49 forks source link

constant 31536000000 overflows int #6

Closed metalmatze closed 7 years ago

metalmatze commented 7 years ago

When cross compiling for 32-bit architectures durafmt doesn't compile. For example running GOOS=linux GOARCH=386 go build results in vendor/github.com/hako/durafmt/durafmt.go:59:45: constant 31536000000 overflows int. This should probably be fixed.

hako commented 7 years ago

@metalmatze Changedint casts to int64. Compiled, tested and works on 32bit environments. Fixed in https://github.com/hako/durafmt/commit/e0ec634bbc475113b0f21bb57aa1cb8cf1ba1a29. Thanks!