forked from cerc-io/plugeth
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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...))
|
||||
|
||||
Reference in New Issue
Block a user