Auburn / FastNoiseLite

Fast Portable Noise Library - C# C++ C Java HLSL GLSL JavaScript Rust Go
http://auburn.github.io/FastNoiseLite/
MIT License
2.77k stars 326 forks source link

Add go.mod #134

Closed mpfrancis closed 7 months ago

mpfrancis commented 7 months ago

Importing and using the Go fastnoise library currently results in the below errors using the current version of go (v1.22.1). Adding a go.mod with go version 1.21 or higher specified should alleviate these errors.

$ go run main.go
# github.com/Auburn/FastNoiseLite/Go
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:127:14: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:129:14: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:136:12: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:658:10: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:812:14: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:819:14: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:826:14: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:833:15: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:839:16: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:846:16: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
..\..\go\pkg\mod\github.com\!auburn\!fast!noise!lite@v1.1.1\Go\fastnoise.go:846:16: too many errors
Auburn commented 7 months ago

If it only requires 1.18 shouldn't it be set to that?

mpfrancis commented 7 months ago

I tried 1.18, there was a different set of errors requiring 1.21.

$ go run main.go
# github.com/Auburn/FastNoiseLite/Go
..\FastNoiseLite\Go\fastnoise.go:685:19: implicitly instantiated function in assignment requires go1.21 or later (-lang was set to go1.18; check go.mod)
..\FastNoiseLite\Go\fastnoise.go:686:19: implicitly instantiated function in assignment requires go1.21 or later (-lang was set to go1.18; check go.mod)
..\FastNoiseLite\Go\fastnoise.go:688:19: implicitly instantiated function in assignment requires go1.21 or later (-lang was set to go1.18; check go.mod)
..\FastNoiseLite\Go\fastnoise.go:689:19: implicitly instantiated function in assignment requires go1.21 or later (-lang was set to go1.18; check go.mod)
..\FastNoiseLite\Go\fastnoise.go:691:19: implicitly instantiated function in assignment requires go1.21 or later (-lang was set to go1.18; check go.mod)
..\FastNoiseLite\Go\fastnoise.go:692:19: implicitly instantiated function in assignment requires go1.21 or later (-lang was set to go1.18; check go.mod)
..\FastNoiseLite\Go\fastnoise.go:696:20: implicitly instantiated function in assignment requires go1.21 or later (-lang was set to go1.18; check go.mod)
..\FastNoiseLite\Go\fastnoise.go:697:20: implicitly instantiated function in assignment requires go1.21 or later (-lang was set to go1.18; check go.mod)
..\FastNoiseLite\Go\fastnoise.go:699:20: implicitly instantiated function in assignment requires go1.21 or later (-lang was set to go1.18; check go.mod)
..\FastNoiseLite\Go\fastnoise.go:700:20: implicitly instantiated function in assignment requires go1.21 or later (-lang was set to go1.18; check go.mod)
..\FastNoiseLite\Go\fastnoise.go:700:20: too many errors
Auburn commented 7 months ago

I don't know anything about Go but could that second error be fixed by making what is complaining about explicit? v1.21 looks to be fairly recent, it would better to only require v1.18

Auburn commented 7 months ago

Great! Thanks for the help