Skip to content

Commit

Permalink
pkg: fix deprecated things
Browse files Browse the repository at this point in the history
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
  • Loading branch information
zchee authored and yongxiu committed Mar 29, 2024
1 parent 289724c commit 5d9955a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/crd/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ func builtinToType(basic *types.Basic, allowDangerousTypes bool) (typ string, fo
// Open coded go/types representation of encoding/json.Marshaller
var jsonMarshaler = types.NewInterfaceType([]*types.Func{
types.NewFunc(token.NoPos, nil, "MarshalJSON",
types.NewSignature(nil, nil,
types.NewSignatureType(nil, nil, nil, nil,
types.NewTuple(
types.NewVar(token.NoPos, nil, "", types.NewSlice(types.Universe.Lookup("byte").Type())),
types.NewVar(token.NoPos, nil, "", types.Universe.Lookup("error").Type())), false)),
Expand Down
6 changes: 3 additions & 3 deletions pkg/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func LoadRootsWithConfig(cfg *packages.Config, roots ...string) ([]*Package, err
cfg: cfg,
packages: make(map[*packages.Package]*Package),
}
l.cfg.Mode |= packages.LoadImports | packages.NeedTypesSizes
l.cfg.Mode |= packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles | packages.NeedImports | packages.NeedTypesSizes
if l.cfg.Fset == nil {
l.cfg.Fset = token.NewFileSet()
}
Expand Down Expand Up @@ -596,9 +596,9 @@ func LoadRootsWithConfig(cfg *packages.Config, roots ...string) ([]*Package, err
// references with those from the rootPkgs list. This ensures the
// kubebuilder marker generation is handled correctly. For more info,
// please see issue 680.
func visitImports(rootPkgs []*Package, pkg *Package, seen sets.String) {
func visitImports(rootPkgs []*Package, pkg *Package, seen sets.Set[string]) {
if seen == nil {
seen = sets.String{}
seen = sets.Set[string]{}
}
for importedPkgID, importedPkg := range pkg.Imports() {
for i := range rootPkgs {
Expand Down

0 comments on commit 5d9955a

Please sign in to comment.