go-reform / reform

A better ORM for Go, based on non-empty interfaces and code generation.
https://gopkg.in/reform.v1
MIT License
1.44k stars 73 forks source link

Go 1.15: generated code does not pass go vet #245

Closed uzzz closed 3 years ago

uzzz commented 4 years ago

Describe the bug With go 1.15 generated code that does not pass go test because of go vet warning.

To Reproduce

$ go version
go version go1.15 darwin/amd64

$ reform --version
v1.4.1

$ cat test.go 
package main

//go:generate reform

//reform:items
type item struct {
    ID string `reform:"id,pk"`
}

$ go generate ./...
$ go test ./...
./test_reform.go:107:10: conversion from int64 to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Expected behavior No error on go vet

Additional context https://github.com/golang/go/issues/32479

skamenetskiy commented 4 years ago

I can see a pull request, when is it planned to go into release? go1.15 is currently broken 😞

AlekSi commented 4 years ago

Unfortunately, that PR is not enough. Workaround for now: go test -vet=atomic,bool,buildtags,errorsas,ifaceassert,nilfunc,printf

AlekSi commented 3 years ago

Please try v1.5.0-beta1

AlekSi commented 3 years ago

v1.5.0 released. See https://github.com/go-reform/reform/issues/269 for more in-depth explanation.

uzzz commented 3 years ago

Yes, seems fine now, thanks for fixing it.