googleapis / go-sql-spanner

Google Cloud Spanner driver for Go's database/sql package.
Apache License 2.0
104 stars 24 forks source link

go vet warning: self-assignment of sql to sql #249

Open egonelbre opened 5 months ago

egonelbre commented 5 months ago

go vet indicates there's a mistake related to the code in https://github.com/googleapis/go-sql-spanner/blob/6c5c8cb70166ae0abe0f8b2c764cf1970f8cab96/statement_parser.go#L298

$ go vet ./...
# github.com/googleapis/go-sql-spanner
# [github.com/googleapis/go-sql-spanner]
./statement_parser.go:298:3: self-assignment of sql to sql

This also indicates that there's no linting setup for the project. Usually the good starting options are go vet and staticcheck, because they have the least amount of noise.

~PS: I also noticed that the tests are running without -race, which may hide some bugs as well.~