gojp / goreportcard

A report card for your Go application
https://goreportcard.com
Apache License 2.0
2.01k stars 249 forks source link

`gofmt` and `ineffassign` uses go version 1.17 on 1.18-beta1 #370

Closed medmouine closed 2 years ago

medmouine commented 2 years ago

I have a public module that uses Go v1.18BETA1 but the checks are made using an older version (I am guessing 1.17) on gofmt and ineffassign which gives error related to generics syntax.

Example gofmt:

either/right.go
Line 5: expected ']', found any:1::warning: file is not gofmted with -s (gofmt)
maybe/maybe.go
Line 6: expected ';', found '|':1::warning: file is not gofmted with -s (gofmt)
Line 9: expected '}', found 'type':1::warning: file is not gofmted with -s (gofmt)
Line 20: expected ']', found any:1::warning: file is not gofmted with -s (gofmt)
Line 26: expected declaration, found 'if':1::warning: file is not gofmted with -s (gofmt)
either/either.go
Line 5: expected ']', found any:1::warning: file is not gofmted with -s (gofmt)
Line 27: expected ']', found any:1::warning: file is not gofmted with -s (gofmt)
either/either_test.go
Line 127: expected ']' or ':', found ',':1::warning: file is not gofmted with -s (gofmt)
Line 149: expected ']' or ':', found ',':1::warning: file is not gofmted with -s (gofmt)
Line 165: expected ']' or ':', found ',':1::warning: file is not gofmted with -s (gofmt)
Line 179: expected ']' or ':', found ',':1::warning: file is not gofmted with -s (gofmt)
Line 197: expected ']' or ':', found ',':1::warning: file is not gofmted with -s (gofmt)
Line 217: expected ']' or ':', found ',':1::warning: file is not gofmted with -s (gofmt)
Line 239: expected ']' or ':', found ',':1::warning: file is not gofmted with -s (gofmt)
Line 261: expected ']' or ':', found ',':1::warning: file is not gofmted with -s (gofmt)
result/result.go
Line 5: expected ']', found any:1::warning: file is not gofmted with -s (gofmt)
Line 22: expected ']', found any:1::warning: file is not gofmted with -s (gofmt)
Line 29: expected declaration, found 'return':1::warning: file is not gofmted with -s (gofmt)
either/left.go
Line 5: expected ']', found any:1::warning: file is not gofmted with -s (gofmt)

I can confirm gofmt on v1.18 does not return any issues.

How to replicate:

$ git clone https://github.com/medmouine/gomad

$ gobrew use 1.17

$ gofmt -s -d .
either/either.go:11:15: expected ']', found any
either/either.go:33:15: expected ']', found any
either/either_test.go:127:13: expected ']' or ':', found ','
either/either_test.go:149:13: expected ']' or ':', found ','
either/either_test.go:165:21: expected ']' or ':', found ','
either/either_test.go:179:21: expected ']' or ':', found ','
either/either_test.go:197:21: expected ']' or ':', found ','
either/either_test.go:217:21: expected ']' or ':', found ','
either/either_test.go:239:13: expected ']' or ':', found ','
either/either_test.go:261:13: expected ']' or ':', found ','
either/left.go:5:13: expected ']', found any
either/right.go:5:14: expected ']', found any
maybe/maybe.go:6:6: expected ';', found '|'
maybe/maybe.go:15:1: expected '}', found 'type'
maybe/maybe.go:26:14: expected ']', found any
maybe/maybe.go:35:2: expected declaration, found 'if'
result/result.go:9:15: expected ']', found any
result/result.go:26:15: expected ']', found any
result/result.go:36:2: expected declaration, found 'return'

$ gobrew use 1.18beta1

$ gofmt -s -d .
$ 
shawnps commented 2 years ago

@medmouine we use the latest stable version of Go which is currently 1.17

shawnps commented 2 years ago

Go Report Card is now using Go 1.18