Skip to content

Commit

Permalink
Merge pull request #36 from mgh520/fix_logging
Browse files Browse the repository at this point in the history
fix typos in error messages
  • Loading branch information
miladrahimi authored Feb 4, 2022
2 parents 6fe93eb + 2be3152 commit e7e6d68
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (c *Config) SetupListener(fallback func(err error)) *Config {
// feedStruct feeds a struct using given feeder.
func (c *Config) feedStruct(f Feeder, s interface{}) error {
if err := f.Feed(s); err != nil {
return fmt.Errorf("config: faild to feed struct; err %v", err)
return fmt.Errorf("config: failed to feed struct; err %v", err)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/feeder/dotenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type DotEnv struct {
func (f DotEnv) Feed(structure interface{}) error {
file, err := os.Open(filepath.Clean(f.Path))
if err != nil {
return fmt.Errorf("config: cannot open json file; err: %v", err)
return fmt.Errorf("config: cannot open env file; err: %v", err)
}

if err = dotenv.NewDecoder(file).Decode(structure); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/feeder/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Toml struct {
func (f Toml) Feed(structure interface{}) error {
file, err := os.Open(filepath.Clean(f.Path))
if err != nil {
return fmt.Errorf("config: cannot open json file; err: %v", err)
return fmt.Errorf("config: cannot open toml file; err: %v", err)
}

if _, err = toml.NewDecoder(file).Decode(structure); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/feeder/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Yaml struct {
func (f Yaml) Feed(structure interface{}) error {
file, err := os.Open(filepath.Clean(f.Path))
if err != nil {
return fmt.Errorf("config: cannot open json file; err: %v", err)
return fmt.Errorf("config: cannot open yaml file; err: %v", err)
}

if err = yaml.NewDecoder(file).Decode(structure); err != nil {
Expand Down

0 comments on commit e7e6d68

Please sign in to comment.