diff --git a/ci/test.sh b/ci/test.sh index 9dd1fb8..27092bd 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -1,9 +1,6 @@ #!/bin/bash # This script is used to ensure that the go.mod file is up to date. -# Compatibility for Go 1.22 -export GODEBUG=gotypesalias=1 - set -euo pipefail for i in $(find $PWD -name go.mod); do diff --git a/mockgen/import_mode_test.go b/mockgen/import_mode_test.go index 99cd7ba..c5df56a 100644 --- a/mockgen/import_mode_test.go +++ b/mockgen/import_mode_test.go @@ -313,10 +313,7 @@ func Test_importModeParser_parsePackage(t *testing.T) { Name: "AddHumans", In: []*model.Parameter{ { - Type: &model.NamedType{ - Package: "go.uber.org/mock/mockgen/internal/tests/import_mode", - Type: "HumansCount", - }, + Type: model.PredeclaredType("int"), }, }, Out: []*model.Parameter{ @@ -325,7 +322,7 @@ func Test_importModeParser_parsePackage(t *testing.T) { Len: -1, // slice Type: &model.NamedType{ Package: "go.uber.org/mock/mockgen/internal/tests/import_mode", - Type: "Human", + Type: "Primate", }, }, }, @@ -335,10 +332,7 @@ func Test_importModeParser_parsePackage(t *testing.T) { Name: "HumanPopulation", Out: []*model.Parameter{ { - Type: &model.NamedType{ - Package: "go.uber.org/mock/mockgen/internal/tests/import_mode", - Type: "HumansCount", - }, + Type: model.PredeclaredType("int"), }, }, }, diff --git a/mockgen/internal/tests/import_mode/mock/interfaces.go b/mockgen/internal/tests/import_mode/mock/interfaces.go index d99ecbf..0279d21 100644 --- a/mockgen/internal/tests/import_mode/mock/interfaces.go +++ b/mockgen/internal/tests/import_mode/mock/interfaces.go @@ -1382,10 +1382,10 @@ func (m *MockEarth) EXPECT() *MockEarthMockRecorder { } // AddHumans mocks base method. -func (m *MockEarth) AddHumans(arg0 import_mode.HumansCount) []import_mode.Human { +func (m *MockEarth) AddHumans(arg0 int) []import_mode.Primate { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AddHumans", arg0) - ret0, _ := ret[0].([]import_mode.Human) + ret0, _ := ret[0].([]import_mode.Primate) return ret0 } @@ -1402,28 +1402,28 @@ type MockEarthAddHumansCall struct { } // Return rewrite *gomock.Call.Return -func (c *MockEarthAddHumansCall) Return(arg0 []import_mode.Human) *MockEarthAddHumansCall { +func (c *MockEarthAddHumansCall) Return(arg0 []import_mode.Primate) *MockEarthAddHumansCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockEarthAddHumansCall) Do(f func(import_mode.HumansCount) []import_mode.Human) *MockEarthAddHumansCall { +func (c *MockEarthAddHumansCall) Do(f func(int) []import_mode.Primate) *MockEarthAddHumansCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEarthAddHumansCall) DoAndReturn(f func(import_mode.HumansCount) []import_mode.Human) *MockEarthAddHumansCall { +func (c *MockEarthAddHumansCall) DoAndReturn(f func(int) []import_mode.Primate) *MockEarthAddHumansCall { c.Call = c.Call.DoAndReturn(f) return c } // HumanPopulation mocks base method. -func (m *MockEarth) HumanPopulation() import_mode.HumansCount { +func (m *MockEarth) HumanPopulation() int { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HumanPopulation") - ret0, _ := ret[0].(import_mode.HumansCount) + ret0, _ := ret[0].(int) return ret0 } @@ -1440,19 +1440,19 @@ type MockEarthHumanPopulationCall struct { } // Return rewrite *gomock.Call.Return -func (c *MockEarthHumanPopulationCall) Return(arg0 import_mode.HumansCount) *MockEarthHumanPopulationCall { +func (c *MockEarthHumanPopulationCall) Return(arg0 int) *MockEarthHumanPopulationCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockEarthHumanPopulationCall) Do(f func() import_mode.HumansCount) *MockEarthHumanPopulationCall { +func (c *MockEarthHumanPopulationCall) Do(f func() int) *MockEarthHumanPopulationCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEarthHumanPopulationCall) DoAndReturn(f func() import_mode.HumansCount) *MockEarthHumanPopulationCall { +func (c *MockEarthHumanPopulationCall) DoAndReturn(f func() int) *MockEarthHumanPopulationCall { c.Call = c.Call.DoAndReturn(f) return c }