Skip to content

Commit

Permalink
build: update linters
Browse files Browse the repository at this point in the history
  • Loading branch information
antonydenyer committed Feb 21, 2023
1 parent be88f5a commit c721ca0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ run:
linters:
disable-all: true
enable:
- deadcode
- goconst
- goimports
- gosimple
- govet
- ineffassign
- misspell
# - staticcheck
- unconvert
# - unused
- varcheck
- typecheck

- unused
- staticcheck
- bidichk
- durationcheck
- exportloopref
- whitespace

linters-settings:
gofmt:
Expand Down
6 changes: 3 additions & 3 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -1013,21 +1013,21 @@ func doPurge(cmdline []string) {

// Iterate over the blobs, collect and sort all unstable builds
for i := 0; i < len(blobs); i++ {
if !strings.Contains(*blobs[i].Name, "unstable") {
if !strings.Contains(blobs[i].Name, "unstable") {
blobs = append(blobs[:i], blobs[i+1:]...)
i--
}
}
for i := 0; i < len(blobs); i++ {
for j := i + 1; j < len(blobs); j++ {
if blobs[i].Properties.LastModified.After(*blobs[j].Properties.LastModified) {
if blobs[i].Properties.LastModified.After(blobs[j].Properties.LastModified) {
blobs[i], blobs[j] = blobs[j], blobs[i]
}
}
}
// Filter out all archives more recent that the given threshold
for i, blob := range blobs {
if time.Since(*blob.Properties.LastModified) < time.Duration(*limit)*24*time.Hour {
if time.Since(blob.Properties.LastModified) < time.Duration(*limit)*24*time.Hour {
blobs = blobs[:i]
break
}
Expand Down

0 comments on commit c721ca0

Please sign in to comment.