Skip to content

Commit

Permalink
Merge pull request #41 from github/unneeded-sprintf
Browse files Browse the repository at this point in the history
Remove some unneeded `fmt.Sprintf(...)` calls.
  • Loading branch information
chrisgavin authored Aug 28, 2020
2 parents 5bd18e0 + 430a829 commit 747f0b3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package pull
import (
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
Expand Down Expand Up @@ -147,19 +146,19 @@ func (pullService *pullService) findRelevantReleases() ([]string, error) {
log.Debugf("Found %s.", reference.Name().String())
commit, err := localRepository.CommitObject(reference.Hash())
if err != nil {
return errors.Wrap(err, fmt.Sprintf("Error loading commit %s for reference %s.", reference.Hash(), reference.Name().String()))
return errors.Wrapf(err, "Error loading commit %s for reference %s.", reference.Hash(), reference.Name().String())
}
file, err := commit.File(defaultConfigurationPath)
if err != nil {
if err == object.ErrFileNotFound {
log.Debugf("Ignoring reference %s as it does not have a default configuration.", reference.Name().String())
return nil
}
return errors.Wrap(err, fmt.Sprintf("Error loading default configuration file from commit %s for reference %s.", reference.Hash(), reference.Name().String()))
return errors.Wrapf(err, "Error loading default configuration file from commit %s for reference %s.", reference.Hash(), reference.Name().String())
}
content, err := file.Contents()
if err != nil {
return errors.Wrap(err, fmt.Sprintf("Error reading default configuration file content from commit %s for reference %s.", reference.Hash(), reference.Name().String()))
return errors.Wrapf(err, "Error reading default configuration file content from commit %s for reference %s.", reference.Hash(), reference.Name().String())
}
configuration, err := actionconfiguration.Parse(content)
if err != nil {
Expand Down

0 comments on commit 747f0b3

Please sign in to comment.