Skip to content

Commit 118e889

Browse files
authored
chore: Fix some linting issues (#337)
web/tls_config.go:261:15 staticcheck ST1005: error strings should not be capitalized web/tls_config.go:431:28 unconvert unnecessary conversion web/tls_config.go:459:28 unconvert unnecessary conversion web/tls_config.go:490:28 unconvert unnecessary conversion web/tls_config.go:272:3 copyloopvar The copy of the 'for' variable "l" can be deleted (Go 1.22+) Signed-off-by: Manuel Rüger <[email protected]>
1 parent 0b90581 commit 118e889

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

web/tls_config.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,11 @@ func ConfigToTLSConfig(c *TLSConfig) (*tls.Config, error) {
254254
case "", "NoClientCert":
255255
cfg.ClientAuth = tls.NoClientCert
256256
default:
257-
return nil, errors.New("Invalid ClientAuth: " + c.ClientAuth)
257+
return nil, errors.New("invalid ClientAuth: " + c.ClientAuth)
258258
}
259259

260260
if (c.ClientCAs != "" || c.ClientCAsText != "") && cfg.ClientAuth == tls.NoClientCert {
261-
return nil, errors.New("Client CA's have been configured without a Client Auth Policy")
261+
return nil, errors.New("client CA's have been configured without a Client Auth Policy")
262262
}
263263

264264
return cfg, nil
@@ -269,7 +269,6 @@ func ConfigToTLSConfig(c *TLSConfig) (*tls.Config, error) {
269269
func ServeMultiple(listeners []net.Listener, server *http.Server, flags *FlagConfig, logger *slog.Logger) error {
270270
errs := new(errgroup.Group)
271271
for _, l := range listeners {
272-
l := l
273272
errs.Go(func() error {
274273
return Serve(l, server, flags, logger)
275274
})
@@ -428,7 +427,7 @@ type Cipher uint16
428427

429428
func (c *Cipher) UnmarshalYAML(unmarshal func(interface{}) error) error {
430429
var s string
431-
err := unmarshal((*string)(&s))
430+
err := unmarshal(&s)
432431
if err != nil {
433432
return err
434433
}
@@ -456,7 +455,7 @@ var curves = map[string]Curve{
456455

457456
func (c *Curve) UnmarshalYAML(unmarshal func(interface{}) error) error {
458457
var s string
459-
err := unmarshal((*string)(&s))
458+
err := unmarshal(&s)
460459
if err != nil {
461460
return err
462461
}
@@ -487,7 +486,7 @@ var tlsVersions = map[string]TLSVersion{
487486

488487
func (tv *TLSVersion) UnmarshalYAML(unmarshal func(interface{}) error) error {
489488
var s string
490-
err := unmarshal((*string)(&s))
489+
err := unmarshal(&s)
491490
if err != nil {
492491
return err
493492
}

0 commit comments

Comments
 (0)