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

refactor: Fix golanglint action error #3666

Merged
merged 1 commit into from
Nov 13, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/nerdctl/container/container_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ func getChanges(ctx context.Context, client *containerd.Client, container contai
return changes, err
}

func appendChanges(changes []fs.Change, new fs.Change) []fs.Change {
newDir, _ := filepath.Split(new.Path)
func appendChanges(changes []fs.Change, fsChange fs.Change) []fs.Change {
newDir, _ := filepath.Split(fsChange.Path)
newDirPath := filepath.SplitList(newDir)

if len(changes) == 0 {
Expand All @@ -208,7 +208,7 @@ func appendChanges(changes []fs.Change, new fs.Change) []fs.Change {
Path: filepath.Join(newDirPath[:i+1]...),
})
}
return append(changes, new)
return append(changes, fsChange)
}
last := changes[len(changes)-1]
lastDir, _ := filepath.Split(last.Path)
Expand All @@ -222,7 +222,7 @@ func appendChanges(changes []fs.Change, new fs.Change) []fs.Change {
Path: filepath.Join(newDirPath[:i+1]...),
})
}
return append(changes, new)
return append(changes, fsChange)
}

func diffShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
Expand Down
8 changes: 4 additions & 4 deletions pkg/imgutil/filtering.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,12 @@ func filter[T any](items []T, f func(item T) (bool, error)) ([]T, error) {
return filteredItems, nil
}

func imageCreatedBetween(image images.Image, min time.Time, max time.Time) bool {
return image.CreatedAt.After(min) && image.CreatedAt.Before(max)
func imageCreatedBetween(image images.Image, minTime time.Time, maxTime time.Time) bool {
return image.CreatedAt.After(minTime) && image.CreatedAt.Before(maxTime)
}

func imageCreatedBefore(image images.Image, max time.Time) bool {
return image.CreatedAt.Before(max)
func imageCreatedBefore(image images.Image, maxTime time.Time) bool {
return image.CreatedAt.Before(maxTime)
}

func matchesAllLabels(imageCfgLabels map[string]string, filterLabels map[string]string) bool {
Expand Down