Skip to content

Commit

Permalink
Merge pull request #3666 from Zheaoli/manjusaka/fix-golang-lint-error
Browse files Browse the repository at this point in the history
refactor: Fix golanglint action error
  • Loading branch information
Zheaoli authored Nov 13, 2024
2 parents 8b814ca + 7dce7c7 commit 7a0b958
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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

0 comments on commit 7a0b958

Please sign in to comment.