build(deps): bump github.com/gookit/config/v2 from 2.2.6 to 2.2.7

Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.2.6 to 2.2.7.
- [Release notes](https://github.com/gookit/config/releases)
- [Commits](https://github.com/gookit/config/compare/v2.2.6...v2.2.7)

---
updated-dependencies:
- dependency-name: github.com/gookit/config/v2
  dependency-version: 2.2.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2025-08-15 14:15:33 +00:00
committed by GitHub
parent 28770fe20d
commit 89a7d171ee
180 changed files with 7454 additions and 9644 deletions
+11
View File
@@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"io"
"os"
)
// MustString encode data to json string, will panic on error
@@ -62,3 +63,13 @@ func DecodeString(str string, ptr any) error {
func DecodeReader(r io.Reader, ptr any) error {
return json.NewDecoder(r).Decode(ptr)
}
// DecodeFile decode JSON from file, bind data to ptr.
func DecodeFile(file string, ptr any) error {
bs, err := os.ReadFile(file)
if err != nil {
return err
}
return json.Unmarshal(bs, ptr)
}