Skip to content

Commit

Permalink
added lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlso committed May 25, 2024
1 parent 69158fd commit 8ad85fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions cmd/folder_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ func (h *FolderHandler) CRDs() ([]*v1beta1.CustomResourceDefinition, error) {

var crds []*v1beta1.CustomResourceDefinition

if err := filepath.WalkDir(h.location, func(path string, d fs.DirEntry, err error) error {
if d.IsDir() {
if err := filepath.Walk(h.location, func(path string, info fs.FileInfo, err error) error {
if err != nil {
return err
}

if info.IsDir() {
return nil
}

if filepath.Ext(path) != ".yaml" {
fmt.Println("skipping file " + path)
fmt.Fprintln(os.Stderr, "skipping file "+path)

return nil
}
Expand All @@ -39,9 +43,9 @@ func (h *FolderHandler) CRDs() ([]*v1beta1.CustomResourceDefinition, error) {

crd := &v1beta1.CustomResourceDefinition{}
if err := yaml.Unmarshal(content, crd); err != nil {
fmt.Println("skipping none CRD file: ", path)
fmt.Fprintln(os.Stderr, "skipping none CRD file: "+path)

return nil
return nil //nolint:nilerr // intentional
}

crds = append(crds, crd)
Expand Down
2 changes: 1 addition & 1 deletion cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func runGenerate(_ *cobra.Command, _ []string) error {

var w io.WriteCloser

var errs []error
var errs []error //nolint:prealloc // nope
for _, crd := range crds {
if args.stdOut {
w = os.Stdout
Expand Down

0 comments on commit 8ad85fc

Please sign in to comment.