Skip to content

Commit

Permalink
Simplify error return from 'ipset list'
Browse files Browse the repository at this point in the history
exec.Output() already wraps the stderr output, so we don't need to do that.
  • Loading branch information
bboreham committed Mar 6, 2017
1 parent 675b713 commit fd77290
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions npc/ipset/ipset.go
Expand Up @@ -77,9 +77,9 @@ func (i *ipset) DestroyAll() error {

// Fetch a list of all existing sets with a given prefix
func (i *ipset) List(prefix string) ([]Name, error) {
output, err := exec.Command("ipset", "list", "-name", "-output", "plain").CombinedOutput()
output, err := exec.Command("ipset", "list", "-name", "-output", "plain").Output()
if err != nil {
return nil, errors.Wrapf(err, "ipset list failed: %s", output)
return nil, err
}

var selected []Name
Expand Down

0 comments on commit fd77290

Please sign in to comment.