Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Fix deprecated things #882

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
8 changes: 4 additions & 4 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 All @@ -393,7 +393,7 @@ func LoadRootsWithConfig(cfg *packages.Config, roots ...string) ([]*Package, err
// and try and prevent packages from showing up twice when nested module
// support is enabled. there is not harm that comes from this per se, but
// it makes testing easier when a known number of modules can be asserted
uniquePkgIDs := sets.String{}
uniquePkgIDs := sets.Set[string]{}

// loadPackages returns the Go packages for the provided roots
//
Expand Down Expand Up @@ -604,9 +604,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