Skip to content

Commit 9346867

Browse files
committed
Fix linting issues
1 parent c75bd68 commit 9346867

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

pkg/applyconfigurations/applyconfiguration_integration_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"io"
2222
"io/fs"
2323
"os"
24-
"sort"
2524
"strings"
2625

2726
. "github.com/onsi/ginkgo"
@@ -44,15 +43,6 @@ func (m outputToMap) Open(_ *loader.Package, path string) (io.WriteCloser, error
4443
return m[path], nil
4544
}
4645

47-
func (m outputToMap) fileList() []string {
48-
ret := make([]string, 0, len(m))
49-
for path := range m {
50-
ret = append(ret, path)
51-
}
52-
sort.Strings(ret)
53-
return ret
54-
}
55-
5646
type outputFile struct {
5747
contents []byte
5848
}

pkg/applyconfigurations/gen.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ const importPathSuffix = "applyconfiguration"
5555
type Generator struct {
5656
// HeaderFile specifies the header text (e.g. license) to prepend to generated files.
5757
HeaderFile string `marker:",optional"`
58-
59-
outputPath string
6058
}
6159

6260
func (Generator) CheckFilter() loader.NodeFilter {
@@ -166,15 +164,15 @@ func (u *Universe) existingApplyConfigPath(_ *types.Named, pkgPath string) (stri
166164
return "", false
167165
}
168166

169-
func (u *Universe) IsApplyConfigGenerated(typeInfo *types.Named, pkgPath string) bool {
167+
func (u *Universe) IsApplyConfigGenerated(typeInfo *types.Named) bool {
170168
if t, ok := u.typeMetadata[typeInfo]; ok {
171169
return t.used
172170
}
173171
return false
174172
}
175173

176174
func (u *Universe) GetApplyConfigPath(typeInfo *types.Named, pkgPath string) (string, bool) {
177-
isApplyConfigGenerated := u.IsApplyConfigGenerated(typeInfo, pkgPath)
175+
isApplyConfigGenerated := u.IsApplyConfigGenerated(typeInfo)
178176
if path, ok := u.existingApplyConfigPath(typeInfo, pkgPath); ok {
179177
if isApplyConfigGenerated {
180178
return path, true
@@ -251,7 +249,7 @@ func (ctx *ObjectGenCtx) generateForPackage(root *loader.Package) error {
251249

252250
packages := applygenerator.Packages(c, genericArgs)
253251
if err := c.ExecutePackages(genericArgs.OutputBase, packages); err != nil {
254-
return err
252+
return fmt.Errorf("error executing packages: %w", err)
255253
}
256254

257255
return nil

0 commit comments

Comments
 (0)