Skip to content

Commit

Permalink
api/types: fix non-constant format string in call (govet)
Browse files Browse the repository at this point in the history
    api/types/container/hostconfig.go:328:43: printf: non-constant format string in call to fmt.Errorf (govet)
                return &errInvalidParameter{fmt.Errorf(msg)}
                                                       ^
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Aug 27, 2024
1 parent 0fd3a53 commit 005b488
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/types/container/hostconfig.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package container // import "github.com/docker/docker/api/types/container"

import (
"errors"
"fmt"
"strings"

Expand Down Expand Up @@ -325,12 +326,12 @@ func ValidateRestartPolicy(policy RestartPolicy) error {
if policy.MaximumRetryCount < 0 {
msg += " and cannot be negative"
}
return &errInvalidParameter{fmt.Errorf(msg)}
return &errInvalidParameter{errors.New(msg)}
}
return nil
case RestartPolicyOnFailure:
if policy.MaximumRetryCount < 0 {
return &errInvalidParameter{fmt.Errorf("invalid restart policy: maximum retry count cannot be negative")}
return &errInvalidParameter{errors.New("invalid restart policy: maximum retry count cannot be negative")}
}
return nil
case "":
Expand Down

0 comments on commit 005b488

Please sign in to comment.