robpike / ivy

ivy, an APL-like calculator
Other
1.33k stars 103 forks source link

value: add BigInt.Float64 for Go 1.20 and older #152

Closed dmitshur closed 1 year ago

dmitshur commented 1 year ago

In Go 1.21, big.Int got a new method Float64 (proposal golang/go#56984). In Go 1.21, BigInt has that method because it embeds *big.Int. In Go 1.20 and older, it's possible to implement it ourselves.

The README and go.mod say that ivy requires Go 1.17 to be built, so add the Float64 implementation with an appropriate build constraint.

dmitshur commented 1 year ago

I tested this on Go 1.17.13 by running GOTOOLCHAIN=go1.17.13 go test ./.... It fixes the build error, and all tests pass other than testdata/sys.ivy:85 (this is #151) and TestHelp (not related).

robpike commented 1 year ago

Thanks but I just bumped to 1.21

fzipp commented 1 year ago

Just a suggestion: You can create a .github/workflows/build.yml file like this in the repository, and GitHub will run the tests for you with the Go version specified by "go-version" on each push, and notify you on failure.

It being in a dotfile directory and YAML is not beautiful, but it does the job.