Skip to content

Commit

Permalink
LoadAllSyntax -> LoadSyntax, address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobOaks committed Oct 28, 2024
1 parent e36794b commit eb1fdaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mockgen/package_mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type packageModeParser struct {
//
// We prefer to use aliases used in the source rather than underlying type names
// as those may be unexported or internal.
// Once mock is Go1.23+ only, we can remove this
// TODO(joaks): Once mock is Go1.23+ only, we can remove this
// as the casing for types.Alias will automatically handle this
// in all cases.
aliasReplacements map[types.Type]aliasReplacement
Expand Down Expand Up @@ -147,7 +147,7 @@ func (p *packageModeParser) loadPackage(packageName string) (*packages.Package,
}

cfg := &packages.Config{
Mode: packages.NeedDeps | packages.NeedImports | packages.NeedTypes | packages.NeedTypesInfo | packages.NeedEmbedFiles | packages.LoadAllSyntax,
Mode: packages.NeedDeps | packages.NeedImports | packages.NeedTypes | packages.NeedTypesInfo | packages.NeedEmbedFiles | packages.LoadSyntax,
BuildFlags: buildFlagsSet,
}
pkgs, err := packages.Load(cfg, packageName)
Expand Down
4 changes: 2 additions & 2 deletions mockgen/package_mode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ func Test_packageModeParser_parsePackage(t *testing.T) {
}

// This tests the alias replacement behavior of package mode.
// Along with the functionality itself, that can be removed
// once we bump go.mod to 1.23.
// TODO(joaks): Update this once we remove the replacement logic
// when we bump go.mod to 1.23.
func TestAliases(t *testing.T) {
packageName := "go.uber.org/mock/mockgen/internal/tests/alias"
for _, tt := range []struct {
Expand Down

0 comments on commit eb1fdaf

Please sign in to comment.