update linters for go1.25 base version

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2026-01-09 18:54:15 -08:00
parent 8037f199db
commit c5154b3169
30 changed files with 76 additions and 77 deletions
-1
View File
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows
package confutil
-1
View File
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows
package confutil
@@ -133,9 +133,9 @@ func parseConfigKey(key string) alternativeConfig {
var out alternativeConfig
var mainPart, scopePart string
if i := strings.IndexByte(key, '@'); i >= 0 {
mainPart = key[:i]
scopePart = key[i+1:]
if before, after, ok := strings.Cut(key, "@"); ok {
mainPart = before
scopePart = after
} else {
mainPart = key
}
@@ -153,14 +153,14 @@ func parseConfigKey(key string) alternativeConfig {
return out
}
slash := strings.IndexByte(mainPart, '/')
if slash < 0 {
before, after, ok := strings.Cut(mainPart, "/")
if !ok {
out.host = mainPart
return out
}
out.host = mainPart[:slash]
out.repo = mainPart[slash+1:]
out.host = before
out.repo = after
return out
}
+2 -1
View File
@@ -66,7 +66,8 @@ func GitServeHTTP(c *gitutil.Git, t testing.TB, opts ...GitServeOpt) (url string
}
mux.Handle(prefix, handler(http.StripPrefix(prefix, http.FileServer(http.Dir(dir)))))
l, err := net.Listen("tcp", "localhost:0")
lc := net.ListenConfig{}
l, err := lc.Listen(ctx, "tcp", "localhost:0")
if err != nil {
panic(err)
}
-1
View File
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows
package gitutil
-1
View File
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows
package gitutil
+4 -9
View File
@@ -36,10 +36,7 @@ func NewMuxIO(in In, outs []MuxOut, initIdx int, toggleMessage func(prev int, re
var wg sync.WaitGroup
var mu sync.Mutex
for i, o := range outs {
i, o := i, o
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
if err := copyToFunc(o.Stdout, func() (io.Writer, error) {
if m.cur == i {
return in.Stdout, nil
@@ -51,10 +48,8 @@ func NewMuxIO(in In, outs []MuxOut, initIdx int, toggleMessage func(prev int, re
if err := o.Stdout.Close(); err != nil {
logrus.WithField("output index", i).WithError(err).Warnf("failed to close stdout")
}
}()
wg.Add(1)
go func() {
defer wg.Done()
})
wg.Go(func() {
if err := copyToFunc(o.Stderr, func() (io.Writer, error) {
if m.cur == i {
return in.Stderr, nil
@@ -66,7 +61,7 @@ func NewMuxIO(in In, outs []MuxOut, initIdx int, toggleMessage func(prev int, re
if err := o.Stderr.Close(); err != nil {
logrus.WithField("output index", i).WithError(err).Warnf("failed to close stderr")
}
}()
})
}
go func() {
errToggle := errors.Errorf("toggle IO")
+3 -3
View File
@@ -303,11 +303,11 @@ func writeMasked(w io.Writer, s string) io.Writer {
pr.CloseWithError(readErr)
return
}
var masked string
var masked strings.Builder
for range n {
masked += s
masked.WriteString(s)
}
if _, err := w.Write([]byte(masked)); err != nil {
if _, err := w.Write([]byte(masked.String())); err != nil {
pr.CloseWithError(err)
return
}
-1
View File
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows
package osutil