benhoyt/prig

Prig compiled with Go 1.17 doesn't work when `go` command is 1.18

benhoyt opened this issue · 1 comments

This is because importspkg.Process() returns an error due to the new generics syntax:

$ prig -s -b 'fmt.Println(42)'
main.go:214:10: expected '(', found '[' (and 2 more errors)
func Sort[T int|float64|string](s []T, options ..._sortOption) []T {
         ^

I guess we'll have to be conservative and make the generics test based on whether Prig itself is running with Go 1.18 or not.

reinstall prig will fix this error