Skip to content

Commit

Permalink
chore: fix linter errors (#634)
Browse files Browse the repository at this point in the history
Signed-off-by: Ravi Chamarthy <[email protected]>
  • Loading branch information
rchamarthy authored Aug 27, 2024
1 parent adf0a37 commit 81105cf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ func (c *Container) containerError(theErr error, msg string) error {
}

for _, err := range lxcErrors {
log.Debugf(err)
log.Debugf("%s", err)
}
return errors.Wrapf(theErr, msg)
return errors.Wrap(theErr, msg)
}

func (c *Container) Execute(args []string, stdin io.Reader) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (th *TextHandler) HandleLog(e *log.Entry) error {
}
}

_, err := th.out.WriteString(fmt.Sprintf(e.Message))
_, err := th.out.WriteString(e.Message)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/squashfs/squashfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ func ExtractSingleSquashPolicy(squashFile, extractDir string, policy *ExtractPol
policy.Excuses = map[string]error{}
}

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

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/types/layer_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type LayerType struct {

func (lt LayerType) String() string {
if lt.Verity {
return fmt.Sprintf(lt.Type + "+verity")
return fmt.Sprintf("%s+verity", lt.Type)
}
return lt.Type
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/stackerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func substitute(content string, substitutions []string) (string, error) {

if len(unsupported_messages) > 0 {
for _, msg := range unsupported_messages {
log.Errorf(msg)
log.Errorf("%s", msg)
}
return "", errors.Errorf("%d instances of unsupported placeholders found. Review log for how to update.", len(unsupported_messages))
}
Expand Down

0 comments on commit 81105cf

Please sign in to comment.