From a895b0e92a51e6d46cdbd1453e0efae0da4fac0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 24 Jan 2026 02:52:22 +0000 Subject: [PATCH 1/3] Bump go.yaml.in/yaml/v4 in the all-deps group Bumps the all-deps group with 1 update: [go.yaml.in/yaml/v4](https://github.com/yaml/go-yaml). Updates `go.yaml.in/yaml/v4` from 4.0.0-rc.3 to 4.0.0-rc.4 - [Commits](https://github.com/yaml/go-yaml/compare/v4.0.0-rc.3...v4.0.0-rc.4) --- updated-dependencies: - dependency-name: go.yaml.in/yaml/v4 dependency-version: 4.0.0-rc.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c52954e..7cd28b0 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.22 require ( github.com/Kairum-Labs/should v0.2.2 - go.yaml.in/yaml/v4 v4.0.0-rc.3 + go.yaml.in/yaml/v4 v4.0.0-rc.4 ) diff --git a/go.sum b/go.sum index 833fbdb..9f99a1b 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ github.com/Kairum-Labs/should v0.2.2 h1:bO1kaMGRYRSSpq8MHsmk2MqpA1taLPblPCZy9Jnpt+U= github.com/Kairum-Labs/should v0.2.2/go.mod h1:vP/ASEjUAKoWy/M7uIrAXq69p7/IUWOpEe5R+q/+K34= -go.yaml.in/yaml/v4 v4.0.0-rc.3 h1:3h1fjsh1CTAPjW7q/EMe+C8shx5d8ctzZTrLcs/j8Go= -go.yaml.in/yaml/v4 v4.0.0-rc.3/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= +go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U= +go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= From ab2b9c2ba74b3d44611d6ccff79ed0f244cdc1ec Mon Sep 17 00:00:00 2001 From: Matthew R Kasun Date: Tue, 17 Feb 2026 14:12:52 -0500 Subject: [PATCH 2/3] adjust for removaal of yaml.ParserError --- config.go | 4 ++-- config_test.go | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/config.go b/config.go index 432888c..c9db788 100644 --- a/config.go +++ b/config.go @@ -19,7 +19,7 @@ var ( // ErrInterfaceConversion indicates that supplied T is different from cached type. ErrInterfaceConversion = errors.New("interface conversion") // ErrYAMLMarshal indicates error marshalling supplied data to YAML. - ErrYAMLMarshal = errors.New("unable to marshal data to yaml") + ErrYAMLMarshal = errors.New("unable to (un)marshal data to/from yaml") ) // Get returns the configuration data for the supplied configuration struct type T, caching it after first retrieval. @@ -101,7 +101,7 @@ func fromFile[T any]() (T, error) { return data, fmt.Errorf("read config file %w", err) } if err := yaml.Unmarshal(bytes, &data); err != nil { - return data, fmt.Errorf("unmarshal %w", err) + return data, fmt.Errorf("%w %w", ErrYAMLMarshal, err) } return data, nil } diff --git a/config_test.go b/config_test.go index fdceb07..42e986f 100644 --- a/config_test.go +++ b/config_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/Kairum-Labs/should" - "go.yaml.in/yaml/v4" ) // test struct. @@ -80,10 +79,7 @@ func TestRead(t *testing.T) { err := os.WriteFile(filepath.Join(dir, progName, "config"), []byte("not: [valid"), permission) should.BeNil(t, err) config := testConfig{} - err = Get(&config) - should.NotBeNil(t, err) - expected := &yaml.ParserError{} - should.BeErrorAs(t, err, &expected) + should.BeErrorIs(t, Get(&config), ErrYAMLMarshal) }) t.Run("filepermission", func(t *testing.T) { From 88198e494e4ed5bacaac961ccfe7fa1f7a132ff2 Mon Sep 17 00:00:00 2001 From: Matthew R Kasun Date: Tue, 17 Feb 2026 14:23:08 -0500 Subject: [PATCH 3/3] lint updates --- .golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yml b/.golangci.yml index 71a9368..a2b7688 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -20,6 +20,7 @@ linters: excludes: - G302 - G304 + - G703 revive: enable-default-rules: true exclusions: