gemini
gemini copied to clipboard
MIgrate Go to v1.21
Hi ! I would like to migrate Go from 1.20 to 1.21
What is there on GO 1.21 that we should upgrade to ?
Anyhow testing test tool isn't that straight forward yet.
And the docker image need to update to make sure the right version is used
I failed to compile, with Go 1.21, so there might be more changes needed?
[ykaul@ykaul gemini]$ ./scripts/test.sh scylla
Compile gemini# github.com/scylladb/gemini/pkg/joberror
pkg/joberror/joberror.go:33:16: error: reference to undefined identifier ‘atomic.Int32’
33 | idx atomic.Int32
| ^
pkg/joberror/joberror.go:46:9: error: range clause must have array, slice, string, map, or channel type
46 | for id := range el.errors {
| ^
pkg/joberror/joberror.go:61:17: error: reference to undefined name ‘limit’
61 | limit: limit,
| ^
pkg/joberror/joberror.go:62:17: error: reference to undefined name ‘errors’
62 | errors: make([]*JobError, limit),
| ^
pkg/joberror/joberror.go:62:43: error: non-integer len argument in make
62 | errors: make([]*JobError, limit),
| ^
pkg/joberror/joberror.go:60:9: error: return with value in function with no return type
60 | return &ErrorList{
| ^
pkg/joberror/joberror.go:46:13: error: invalid type for range clause
46 | for id := range el.errors {
| ^
note: module requires Go 1.21
# go.uber.org/zap
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:64:13: error: expected ‘(’
64 | func Objects[T zapcore.ObjectMarshaler](key string, values []T) Field {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:64:16: error: expected ‘]’
64 | func Objects[T zapcore.ObjectMarshaler](key string, values []T) Field {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:64:16: error: expected ‘;’ or newline after top level declaration
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:66:1: error: expected declaration
66 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:68:16: error: expected ‘]’
68 | type objects[T zapcore.ObjectMarshaler] []T
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:70:17: error: expected ‘)’
70 | func (os objects[T]) MarshalLogArray(arr zapcore.ArrayEncoder) error {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:70:17: error: expected function name
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:70:17: error: expected ‘;’ or newline after top level declaration
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:72:48: error: expected declaration
72 | if err := arr.AppendObject(o); err != nil {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:74:17: error: expected declaration
74 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:75:9: error: expected declaration
75 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:76:9: error: expected declaration
76 | return nil
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:77:1: error: expected declaration
77 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:81:27: error: expected ‘]’
81 | type ObjectMarshalerPtr[T any] interface {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:83:9: error: expected declaration
83 | zapcore.ObjectMarshaler
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:84:1: error: expected declaration
84 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:108:18: error: expected ‘(’
108 | func ObjectValues[T any, P ObjectMarshalerPtr[T]](key string, values []T) Field {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:108:21: error: expected ‘]’
108 | func ObjectValues[T any, P ObjectMarshalerPtr[T]](key string, values []T) Field {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:108:21: error: expected ‘;’ or newline after top level declaration
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:110:1: error: expected declaration
110 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:112:21: error: expected ‘]’
112 | type objectValues[T any, P ObjectMarshalerPtr[T]] []T
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:114:22: error: expected ‘)’
114 | func (os objectValues[T, P]) MarshalLogArray(arr zapcore.ArrayEncoder) error {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:114:22: error: expected function name
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:114:22: error: expected ‘;’ or newline after top level declaration
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:123:17: error: expected declaration
123 | if err := arr.AppendObject(p); err != nil {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:123:48: error: expected declaration
123 | if err := arr.AppendObject(p); err != nil {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:125:17: error: expected declaration
125 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:126:9: error: expected declaration
126 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:127:9: error: expected declaration
127 | return nil
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:128:1: error: expected declaration
128 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:145:15: error: expected ‘(’
145 | func Stringers[T fmt.Stringer](key string, values []T) Field {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:145:18: error: expected ‘]’
145 | func Stringers[T fmt.Stringer](key string, values []T) Field {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:145:18: error: expected ‘;’ or newline after top level declaration
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:147:1: error: expected declaration
147 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:149:18: error: expected ‘]’
149 | type stringers[T fmt.Stringer] []T
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:151:19: error: expected ‘)’
151 | func (os stringers[T]) MarshalLogArray(arr zapcore.ArrayEncoder) error {
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:151:19: error: expected function name
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:151:19: error: expected ‘;’ or newline after top level declaration
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:154:9: error: expected declaration
154 | }
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:155:9: error: expected declaration
155 | return nil
| ^
../../go/pkg/mod/go.uber.org/[email protected]/array_go118.go:156:1: error: expected declaration
156 | }
| ^
note: module requires Go 1.19
Compilation failed
(Fedora 39, Golang 1.21, ...)