Skip to content

Commit

Permalink
update goutils to v.0.6.6 and fix problem due to a breaking change (#126
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Tony An committed Mar 4, 2023
1 parent 7198ea9 commit 6216690
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -6,7 +6,7 @@ require (
github.com/BurntSushi/toml v1.2.1
github.com/goccy/go-json v0.10.0
github.com/goccy/go-yaml v1.10.0
github.com/gookit/goutil v0.6.5
github.com/gookit/goutil v0.6.6
github.com/gookit/ini/v2 v2.2.1
github.com/gookit/properties v0.3.0
github.com/hashicorp/hcl v1.0.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Expand Up @@ -28,6 +28,8 @@ github.com/gookit/color v1.5.2 h1:uLnfXcaFjlrDnQDT+NCBcfhrXqYTx/rcCa6xn01Y8yI=
github.com/gookit/color v1.5.2/go.mod h1:w8h4bGiHeeBpvQVePTutdbERIUf3oJE5lZ8HM0UgXyg=
github.com/gookit/goutil v0.6.5 h1:A8S6ZFcXCvQzYreuADyRjn4lIs7X1GQ7y/kU/UD7Q68=
github.com/gookit/goutil v0.6.5/go.mod h1:90KOayLmcX12ZcbvQ6JakwJ7g4GbpzfjkOl7BHk6tAY=
github.com/gookit/goutil v0.6.6 h1:XdvnPocHpKDXA+eykfc/F846Y1V2Vyo3+cV8rfliG90=
github.com/gookit/goutil v0.6.6/go.mod h1:D++7kbQd/6vECyYTxB5tq6AKDIG9ZYwZNhubWJvN9dw=
github.com/gookit/ini/v2 v2.2.1 h1:6fCrz8icnUHhYqGZwu7RtHLh+v+ErrgrAt9+aIcoJCc=
github.com/gookit/ini/v2 v2.2.1/go.mod h1:as7p0WsJg4sufGECEqNdY/+I026qRnyzPa4UYHuuOR4=
github.com/gookit/properties v0.3.0 h1:52NBYMOP5VXm3mKrQSdQoeEPgk2zXBGDF1R/xblsa6Y=
Expand Down
6 changes: 3 additions & 3 deletions load.go
Expand Up @@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"io"
"io/fs"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -318,9 +319,8 @@ func (c *Config) LoadFromDir(dirPath, format string) (err error) {
extName := "." + format
extLen := len(extName)

return fsutil.FindInDir(dirPath, func(fPath string, fi os.FileInfo) error {
baseName := fi.Name()

return fsutil.FindInDir(dirPath, func(fPath string, ent fs.DirEntry) error {
baseName := ent.Name()
if strings.HasSuffix(baseName, extName) {
data, err := c.parseSourceToMap(format, fsutil.MustReadFile(fPath))
if err != nil {
Expand Down

0 comments on commit 6216690

Please sign in to comment.