Skip to content

Commit 81105cf

Browse files
authored
chore: fix linter errors (#634)
Signed-off-by: Ravi Chamarthy <[email protected]>
1 parent adf0a37 commit 81105cf

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

pkg/container/container.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ func (c *Container) containerError(theErr error, msg string) error {
116116
}
117117

118118
for _, err := range lxcErrors {
119-
log.Debugf(err)
119+
log.Debugf("%s", err)
120120
}
121-
return errors.Wrapf(theErr, msg)
121+
return errors.Wrap(theErr, msg)
122122
}
123123

124124
func (c *Container) Execute(args []string, stdin io.Reader) error {

pkg/log/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (th *TextHandler) HandleLog(e *log.Entry) error {
7575
}
7676
}
7777

78-
_, err := th.out.WriteString(fmt.Sprintf(e.Message))
78+
_, err := th.out.WriteString(e.Message)
7979
if err != nil {
8080
return err
8181
}

pkg/squashfs/squashfs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ func ExtractSingleSquashPolicy(squashFile, extractDir string, policy *ExtractPol
625625
policy.Excuses = map[string]error{}
626626
}
627627

628-
if policy.Extractors == nil || len(policy.Extractors) == 0 {
628+
if len(policy.Extractors) == 0 {
629629
policy.Excuses[initName] = errors.Errorf("policy had no extractors")
630630
return policy.Excuses[initName]
631631
}
@@ -647,7 +647,7 @@ func ExtractSingleSquashPolicy(squashFile, extractDir string, policy *ExtractPol
647647
}
648648

649649
// nothing worked. populate Excuses[initName]
650-
policy.Excuses[initName] = errors.Errorf("No suitable extractor found:\n " + strings.Join(allExcuses, "\n "))
650+
policy.Excuses[initName] = errors.Errorf("No suitable extractor found:\n %s", strings.Join(allExcuses, "\n "))
651651
return policy.Excuses[initName]
652652
}
653653

pkg/types/layer_type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type LayerType struct {
1919

2020
func (lt LayerType) String() string {
2121
if lt.Verity {
22-
return fmt.Sprintf(lt.Type + "+verity")
22+
return fmt.Sprintf("%s+verity", lt.Type)
2323
}
2424
return lt.Type
2525
}

pkg/types/stackerfile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func substitute(content string, substitutions []string) (string, error) {
123123

124124
if len(unsupported_messages) > 0 {
125125
for _, msg := range unsupported_messages {
126-
log.Errorf(msg)
126+
log.Errorf("%s", msg)
127127
}
128128
return "", errors.Errorf("%d instances of unsupported placeholders found. Review log for how to update.", len(unsupported_messages))
129129
}

0 commit comments

Comments
 (0)