Skip to content

Commit

Permalink
chore: refactor dockerfile to use errors pkg
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Chadwell <me@jedevc.com>
  • Loading branch information
jedevc committed Nov 23, 2022
1 parent 80d9cee commit 00aab4f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ignorefile/ignorefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package dockerignore
import (
"bufio"
"bytes"
"fmt"
"io"
"path/filepath"
"strings"

"github.com/pkg/errors"
)

// ReadAll reads a .dockerignore file and returns the list of file patterns
Expand Down Expand Up @@ -58,7 +59,7 @@ func ReadAll(reader io.Reader) ([]string, error) {
excludes = append(excludes, pattern)
}
if err := scanner.Err(); err != nil {
return nil, fmt.Errorf("Error reading .dockerignore: %v", err)
return nil, errors.Wrap(err, "error reading .dockerignore")
}
return excludes, nil
}

0 comments on commit 00aab4f

Please sign in to comment.