Skip to content

Commit cc5f635

Browse files
committed
please the linters
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 27bb775 commit cc5f635

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

executor/oci/internal/resolvconf/resolvconf.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func Parse(reader io.Reader, path string) (ResolvConf, error) {
115115
rc.processLine(scanner.Text())
116116
}
117117
if err := scanner.Err(); err != nil {
118-
return ResolvConf{}, errSystem{err}
118+
return ResolvConf{}, systemErr{err}
119119
}
120120
if _, ok := rc.Option("ndots"); ok {
121121
rc.md.NDotsFrom = "host"
@@ -177,7 +177,7 @@ func (rc *ResolvConf) Options() []string {
177177
// Option("ndots") -> ("1", true)
178178
// Option("edns0") -> ("", true)
179179
func (rc *ResolvConf) Option(search string) (string, bool) {
180-
for i := len(rc.options) - 1; i >= 0; i -= 1 {
180+
for i := len(rc.options) - 1; i >= 0; i-- {
181181
k, v, _ := strings.Cut(rc.options[i], ":")
182182
if k == search {
183183
return v, true
@@ -344,10 +344,10 @@ options {{join . " "}}
344344
var buf bytes.Buffer
345345
templ, err := template.New("summary").Funcs(funcs).Parse(templateText)
346346
if err != nil {
347-
return nil, errSystem{err}
347+
return nil, systemErr{err}
348348
}
349349
if err := templ.Execute(&buf, s); err != nil {
350-
return nil, errSystem{err}
350+
return nil, systemErr{err}
351351
}
352352
return buf.Bytes(), nil
353353
}
@@ -419,15 +419,15 @@ func removeInvalidNDots(options []string) []string {
419419
return options[:n]
420420
}
421421

422-
// errSystem implements [github.com/docker/docker/errdefs.ErrSystem].
422+
// systemErr implements [github.com/docker/docker/errdefs.ErrSystem].
423423
//
424424
// We don't use the errdefs helpers here, because the resolvconf package
425425
// is imported in BuildKit, and this is the only location that used the
426426
// errdefs package outside of the client.
427-
type errSystem struct{ error }
427+
type systemErr struct{ error }
428428

429-
func (errSystem) System() {}
429+
func (systemErr) System() {}
430430

431-
func (e errSystem) Unwrap() error {
431+
func (e systemErr) Unwrap() error {
432432
return e.error
433433
}

executor/oci/resolvconf.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package oci
22

33
import (
44
"context"
5-
"fmt"
65
"net/netip"
76
"os"
87
"path/filepath"
@@ -89,7 +88,7 @@ func GetResolvConf(ctx context.Context, stateDir string, idmap *user.IdentityMap
8988
for _, addr := range dns.Nameservers {
9089
ipAddr, err := netip.ParseAddr(addr)
9190
if err != nil {
92-
return struct{}{}, errors.WithStack(fmt.Errorf("bad nameserver address: %w", err))
91+
return struct{}{}, errors.WithStack(errors.Wrap(err, "bad nameserver address"))
9392
}
9493
ns = append(ns, ipAddr)
9594
}

0 commit comments

Comments
 (0)