diff --git a/go.mod b/go.mod index 7f809ad..3baeb3b 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,12 @@ module github.com/Jacobbrewer1/patcher -go 1.23 - -toolchain go1.23.1 +go 1.22 require ( github.com/gorilla/mux v1.8.1 github.com/jmoiron/sqlx v1.4.0 github.com/stretchr/testify v1.9.0 - github.com/vektra/mockery/v2 v2.46.2 + github.com/vektra/mockery/v2 v2.46.0 ) require ( diff --git a/go.sum b/go.sum index b985766..d25c28e 100644 --- a/go.sum +++ b/go.sum @@ -218,8 +218,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/vektra/mockery/v2 v2.46.2 h1:bpUncWvkiDzqn+aWwt4dY1aS0F8Ob4k8+WJrWU/Kh4s= -github.com/vektra/mockery/v2 v2.46.2/go.mod h1:dDivqi0ShM8A29mLgZn13yZ14MdXlTM4V360u8JDWCQ= +github.com/vektra/mockery/v2 v2.46.0 h1:DKIFj6hAPGwmOYiWfWzdsQtBgU8ozPXo3Bwbmf+Ku80= +github.com/vektra/mockery/v2 v2.46.0/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/mock_Joiner.go b/mock_Joiner.go index 31edd4f..28c6b96 100644 --- a/mock_Joiner.go +++ b/mock_Joiner.go @@ -10,7 +10,7 @@ type MockJoiner struct { } // Join provides a mock function with given fields: -func (_m *MockJoiner) Join() (string, []any) { +func (_m *MockJoiner) Join() (string, []interface{}) { ret := _m.Called() if len(ret) == 0 { @@ -18,8 +18,8 @@ func (_m *MockJoiner) Join() (string, []any) { } var r0 string - var r1 []any - if rf, ok := ret.Get(0).(func() (string, []any)); ok { + var r1 []interface{} + if rf, ok := ret.Get(0).(func() (string, []interface{})); ok { return rf() } if rf, ok := ret.Get(0).(func() string); ok { @@ -28,11 +28,11 @@ func (_m *MockJoiner) Join() (string, []any) { r0 = ret.Get(0).(string) } - if rf, ok := ret.Get(1).(func() []any); ok { + if rf, ok := ret.Get(1).(func() []interface{}); ok { r1 = rf() } else { if ret.Get(1) != nil { - r1 = ret.Get(1).([]any) + r1 = ret.Get(1).([]interface{}) } } diff --git a/mock_WhereTyper.go b/mock_WhereTyper.go index 88e0938..9fb7052 100644 --- a/mock_WhereTyper.go +++ b/mock_WhereTyper.go @@ -10,7 +10,7 @@ type MockWhereTyper struct { } // Where provides a mock function with given fields: -func (_m *MockWhereTyper) Where() (string, []any) { +func (_m *MockWhereTyper) Where() (string, []interface{}) { ret := _m.Called() if len(ret) == 0 { @@ -18,8 +18,8 @@ func (_m *MockWhereTyper) Where() (string, []any) { } var r0 string - var r1 []any - if rf, ok := ret.Get(0).(func() (string, []any)); ok { + var r1 []interface{} + if rf, ok := ret.Get(0).(func() (string, []interface{})); ok { return rf() } if rf, ok := ret.Get(0).(func() string); ok { @@ -28,11 +28,11 @@ func (_m *MockWhereTyper) Where() (string, []any) { r0 = ret.Get(0).(string) } - if rf, ok := ret.Get(1).(func() []any); ok { + if rf, ok := ret.Get(1).(func() []interface{}); ok { r1 = rf() } else { if ret.Get(1) != nil { - r1 = ret.Get(1).([]any) + r1 = ret.Get(1).([]interface{}) } } diff --git a/mock_Wherer.go b/mock_Wherer.go index c8e30d8..597f481 100644 --- a/mock_Wherer.go +++ b/mock_Wherer.go @@ -10,7 +10,7 @@ type MockWherer struct { } // Where provides a mock function with given fields: -func (_m *MockWherer) Where() (string, []any) { +func (_m *MockWherer) Where() (string, []interface{}) { ret := _m.Called() if len(ret) == 0 { @@ -18,8 +18,8 @@ func (_m *MockWherer) Where() (string, []any) { } var r0 string - var r1 []any - if rf, ok := ret.Get(0).(func() (string, []any)); ok { + var r1 []interface{} + if rf, ok := ret.Get(0).(func() (string, []interface{})); ok { return rf() } if rf, ok := ret.Get(0).(func() string); ok { @@ -28,11 +28,11 @@ func (_m *MockWherer) Where() (string, []any) { r0 = ret.Get(0).(string) } - if rf, ok := ret.Get(1).(func() []any); ok { + if rf, ok := ret.Get(1).(func() []interface{}); ok { r1 = rf() } else { if ret.Get(1) != nil { - r1 = ret.Get(1).([]any) + r1 = ret.Get(1).([]interface{}) } } diff --git a/vendor/github.com/hashicorp/hcl/.gitignore b/vendor/github.com/hashicorp/hcl/.gitignore index 822fa09..15586a2 100644 --- a/vendor/github.com/hashicorp/hcl/.gitignore +++ b/vendor/github.com/hashicorp/hcl/.gitignore @@ -1,9 +1,9 @@ -y.output - -# ignore intellij files -.idea -*.iml -*.ipr -*.iws - -*.test +y.output + +# ignore intellij files +.idea +*.iml +*.ipr +*.iws + +*.test diff --git a/vendor/github.com/hashicorp/hcl/Makefile b/vendor/github.com/hashicorp/hcl/Makefile index 9fafd50..84fd743 100644 --- a/vendor/github.com/hashicorp/hcl/Makefile +++ b/vendor/github.com/hashicorp/hcl/Makefile @@ -1,18 +1,18 @@ -TEST?=./... - -default: test - -fmt: generate - go fmt ./... - -test: generate - go get -t ./... - go test $(TEST) $(TESTARGS) - -generate: - go generate ./... - -updatedeps: - go get -u golang.org/x/tools/cmd/stringer - -.PHONY: default generate test updatedeps +TEST?=./... + +default: test + +fmt: generate + go fmt ./... + +test: generate + go get -t ./... + go test $(TEST) $(TESTARGS) + +generate: + go generate ./... + +updatedeps: + go get -u golang.org/x/tools/cmd/stringer + +.PHONY: default generate test updatedeps diff --git a/vendor/github.com/vektra/mockery/v2/.golangci.yml b/vendor/github.com/vektra/mockery/v2/.golangci.yml index 379c2f6..d999132 100644 --- a/vendor/github.com/vektra/mockery/v2/.golangci.yml +++ b/vendor/github.com/vektra/mockery/v2/.golangci.yml @@ -13,7 +13,7 @@ linters: - typecheck - contextcheck - durationcheck - - copyloopvar + - exportloopref - gocheckcompilerdirectives - gosec - loggercheck diff --git a/vendor/github.com/vektra/mockery/v2/README.md b/vendor/github.com/vektra/mockery/v2/README.md index 796b9d6..bf62b71 100644 --- a/vendor/github.com/vektra/mockery/v2/README.md +++ b/vendor/github.com/vektra/mockery/v2/README.md @@ -8,7 +8,7 @@ mockery provides the ability to easily generate mocks for Golang interfaces usin Documentation -------------- -Documentation is found at our [GitHub Pages site](https://vektra.github.io/mockery/). +Documentation is found at out [GitHub Pages site](https://vektra.github.io/mockery/). Development ------------ diff --git a/vendor/github.com/vektra/mockery/v2/pkg/config/config.go b/vendor/github.com/vektra/mockery/v2/pkg/config/config.go index 4897432..dee932c 100644 --- a/vendor/github.com/vektra/mockery/v2/pkg/config/config.go +++ b/vendor/github.com/vektra/mockery/v2/pkg/config/config.go @@ -189,7 +189,7 @@ func (c *Config) GetPackages(ctx context.Context) ([]string, error) { if !ok { msg := "packages section is of the wrong type" log.Error().Msg(msg) - return []string{}, errors.New(msg) + return []string{}, fmt.Errorf(msg) } packageList := []string{} for key := range packageSection { @@ -396,7 +396,7 @@ func (c *Config) GetInterfaceConfig(ctx context.Context, packageName string, int return []*Config{pkgConfigCopy}, nil } msgString := "bad type provided for interface config" - log.Error().Msg(msgString) + log.Error().Msgf(msgString) return nil, stackerr.NewStackErr(errors.New(msgString)) } @@ -796,7 +796,7 @@ func (c *Config) mergeInConfig(ctx context.Context) error { // wasn't defined in the yaml. msg := "config section does not exist for package, this should never happen" pkgLog.Error().Msg(msg) - return errors.New(msg) + return fmt.Errorf(msg) } pkgLog.Trace().Msg("got config section for package") diff --git a/vendor/github.com/vektra/mockery/v2/pkg/generator.go b/vendor/github.com/vektra/mockery/v2/pkg/generator.go index 80263a3..2941b48 100644 --- a/vendor/github.com/vektra/mockery/v2/pkg/generator.go +++ b/vendor/github.com/vektra/mockery/v2/pkg/generator.go @@ -437,7 +437,7 @@ func (g *Generator) GeneratePrologueNote(note string) { } prologue += ". DO NOT EDIT.\n" - g.print(prologue) + g.printf(prologue) if note != "" { g.printf("\n") for _, n := range strings.Split(note, "\\n") { @@ -465,10 +465,6 @@ func (g *Generator) GenerateBuildTags(buildTags string) { // type. var ErrNotInterface = errors.New("expression not an interface") -func (g *Generator) print(s string) { - fmt.Fprint(&g.buf, s) -} - func (g *Generator) printf(s string, vals ...interface{}) { fmt.Fprintf(&g.buf, s, vals...) } @@ -499,28 +495,19 @@ type namer interface { Name() string } -func (g *Generator) renderNamedType(ctx context.Context, t interface { - Obj() *types.TypeName - TypeArgs() *types.TypeList -}) string { - name := g.getPackageScopedType(ctx, t.Obj()) - if t.TypeArgs() == nil || t.TypeArgs().Len() == 0 { - return name - } - args := make([]string, 0, t.TypeArgs().Len()) - for i := 0; i < t.TypeArgs().Len(); i++ { - arg := t.TypeArgs().At(i) - args = append(args, g.renderType(ctx, arg)) - } - return fmt.Sprintf("%s[%s]", name, strings.Join(args, ",")) -} - func (g *Generator) renderType(ctx context.Context, typ types.Type) string { switch t := typ.(type) { case *types.Named: - return g.renderNamedType(ctx, t) - case *types.Alias: - return g.renderNamedType(ctx, t) + name := g.getPackageScopedType(ctx, t.Obj()) + if t.TypeArgs() == nil || t.TypeArgs().Len() == 0 { + return name + } + args := make([]string, 0, t.TypeArgs().Len()) + for i := 0; i < t.TypeArgs().Len(); i++ { + arg := t.TypeArgs().At(i) + args = append(args, g.renderType(ctx, arg)) + } + return fmt.Sprintf("%s[%s]", name, strings.Join(args, ",")) case *types.TypeParam: if t.Constraint() != nil { name := t.Obj().Name() @@ -664,7 +651,7 @@ func isNillable(typ types.Type) bool { switch t := typ.(type) { case *types.Pointer, *types.Array, *types.Map, *types.Interface, *types.Signature, *types.Chan, *types.Slice: return true - case *types.Named, *types.Alias: + case *types.Named: return isNillable(t.Underlying()) } return false diff --git a/vendor/github.com/vektra/mockery/v2/pkg/logging/logging.go b/vendor/github.com/vektra/mockery/v2/pkg/logging/logging.go index 0677cf8..b6694ef 100644 --- a/vendor/github.com/vektra/mockery/v2/pkg/logging/logging.go +++ b/vendor/github.com/vektra/mockery/v2/pkg/logging/logging.go @@ -74,7 +74,7 @@ func GetLogger(levelStr string) (zerolog.Logger, error) { Out: out, TimeFormat: time.RFC822, } - if !term.IsTerminal(int(out.Fd())) || os.Getenv("TERM") == "dumb" { //nolint:gosec + if !term.IsTerminal(int(out.Fd())) || os.Getenv("TERM") == "dumb" { writer.NoColor = true } log := zerolog.New(writer). diff --git a/vendor/modules.txt b/vendor/modules.txt index 68737fd..6ffdc07 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -109,8 +109,8 @@ github.com/stretchr/testify/suite # github.com/subosito/gotenv v1.4.2 ## explicit; go 1.18 github.com/subosito/gotenv -# github.com/vektra/mockery/v2 v2.46.2 -## explicit; go 1.23 +# github.com/vektra/mockery/v2 v2.46.0 +## explicit; go 1.22 github.com/vektra/mockery/v2 github.com/vektra/mockery/v2/cmd github.com/vektra/mockery/v2/pkg