Skip to content

Commit

Permalink
add filename to error returned on config read (#27)
Browse files Browse the repository at this point in the history
* add filename to error returned on config read

* Update fsnotify/filewatcher.go

Co-authored-by: Yugandhar Vardhineni <[email protected]>

* remove unnecessary import after commiting feedback

---------

Co-authored-by: Yugandhar Vardhineni <[email protected]>
  • Loading branch information
daniel-garcia and yvardhineni authored Feb 28, 2024
1 parent e981ce9 commit a9750df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fsnotify/filewatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

rfsnotify "github.com/fsnotify/fsnotify"
"github.com/infobloxopen/hotload"
"github.com/pkg/errors"
)

func init() {
Expand Down Expand Up @@ -44,7 +45,7 @@ type pathWatch struct {
func readConfigFile(path string) (v []byte, err error) {
v, err = ioutil.ReadFile(path)
if err != nil {
return
return nil, errors.Wrapf(err, "could not read %v", path)
}
v = []byte(strings.TrimSpace(string(v)))
return
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/lib/pq v1.10.8
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.27.6
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.0
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
Expand Down

0 comments on commit a9750df

Please sign in to comment.