build: upgrade to golangci-lint v1.55.2 (#28712)

This is primarily to make lint work again on macOS 14. The older version of golangci-lint kept crashing. 

Also included is a fix for a goroutine leak in the recently-introduced function MustRunCommandWithOutput.
This commit is contained in:
Felix Lange
2023-12-20 15:36:10 +01:00
committed by GitHub
parent d3452a22cc
commit 8c2d455ccd
4 changed files with 38 additions and 35 deletions
-1
View File
@@ -144,7 +144,6 @@ func Version(csdb *ChecksumDB, version string) (string, error) {
continue
}
if parts[0] == version {
log.Printf("Found version %q", parts[1])
return parts[1], nil
}
}
+9 -2
View File
@@ -73,10 +73,17 @@ func MustRunCommand(cmd string, args ...string) {
// when there is no output.
func MustRunCommandWithOutput(cmd string, args ...string) {
interval := time.NewTicker(time.Minute)
done := make(chan struct{})
defer interval.Stop()
defer close(done)
go func() {
for range interval.C {
fmt.Printf("Waiting for command %q\n", cmd)
for {
select {
case <-interval.C:
fmt.Printf("Waiting for command %q\n", cmd)
case <-done:
return
}
}
}()
MustRun(exec.Command(cmd, args...))