build(deps): require kvconf v0.1.0
- commit
- 8ec4bfc7386d1a8f01af550330e13a047e2c0d49
- author
- brice · · 2026-10-10 03:25 UTC
- parent
- 1894f55
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +6 -4
M go.sum +2 -0
| @@ -1,5 +1,7 @@ | |||
| 1 | 1 | github.com/bnema/go-wayland-bindings v0.1.0 h1:mi2vNa8BB5ZCo/hq/9d6Af01yhqY6QXAZ6pkljFI1xk= | |
| 2 | 2 | github.com/bnema/go-wayland-bindings v0.1.0/go.mod h1:eWOgjp9vzZEqxm059q1G9F5NXplmv9UAmrDJiivxVjA= | |
| 3 | + | github.com/bnema/kvconf v0.1.0 h1:HBtaab447d/rovywZ35t3WUGt6yyi3C6n8Kcs1hHW2Y= | |
| 4 | + | github.com/bnema/kvconf v0.1.0/go.mod h1:+P2X9I/sLx+Lfir45s9a7WA0GnC22WgKbZWE9LK6lcU= | |
| 3 | 5 | github.com/bnema/neferclient v0.3.0 h1:sEBphi11YpgMOPYHW1OcDtQYA8aD3WSaFILnb8fdp90= | |
| 4 | 6 | github.com/bnema/neferclient v0.3.0/go.mod h1:CzZflJIvinLP8u0rYPjdmAnZjl4Ec2cvdnEGvqFO4Yw= | |
| 5 | 7 | github.com/bnema/nefergui v0.7.2 h1:9gnYhVlMxpBp+cVE+9Uursc/HwPXe/Li16+m4HL/gkU= | |
| @@ -1,5 +1,7 @@ | |||||
| 1 | github.com/bnema/go-wayland-bindings v0.1.0 h1:mi2vNa8BB5ZCo/hq/9d6Af01yhqY6QXAZ6pkljFI1xk= | 1 | github.com/bnema/go-wayland-bindings v0.1.0 h1:mi2vNa8BB5ZCo/hq/9d6Af01yhqY6QXAZ6pkljFI1xk= | ||
| 2 | github.com/bnema/go-wayland-bindings v0.1.0/go.mod h1:eWOgjp9vzZEqxm059q1G9F5NXplmv9UAmrDJiivxVjA= | 2 | github.com/bnema/go-wayland-bindings v0.1.0/go.mod h1:eWOgjp9vzZEqxm059q1G9F5NXplmv9UAmrDJiivxVjA= | ||
| 3 | + | github.com/bnema/kvconf v0.1.0 h1:HBtaab447d/rovywZ35t3WUGt6yyi3C6n8Kcs1hHW2Y= | |||
| 4 | + | github.com/bnema/kvconf v0.1.0/go.mod h1:+P2X9I/sLx+Lfir45s9a7WA0GnC22WgKbZWE9LK6lcU= | |||
| 3 | github.com/bnema/neferclient v0.3.0 h1:sEBphi11YpgMOPYHW1OcDtQYA8aD3WSaFILnb8fdp90= | 5 | github.com/bnema/neferclient v0.3.0 h1:sEBphi11YpgMOPYHW1OcDtQYA8aD3WSaFILnb8fdp90= | ||
| 4 | github.com/bnema/neferclient v0.3.0/go.mod h1:CzZflJIvinLP8u0rYPjdmAnZjl4Ec2cvdnEGvqFO4Yw= | 6 | github.com/bnema/neferclient v0.3.0/go.mod h1:CzZflJIvinLP8u0rYPjdmAnZjl4Ec2cvdnEGvqFO4Yw= | ||
| 5 | github.com/bnema/nefergui v0.7.2 h1:9gnYhVlMxpBp+cVE+9Uursc/HwPXe/Li16+m4HL/gkU= | 7 | github.com/bnema/nefergui v0.7.2 h1:9gnYhVlMxpBp+cVE+9Uursc/HwPXe/Li16+m4HL/gkU= | ||
M internal/adapters/config/config.go +4 -4
| @@ -61,7 +61,7 @@ func (o *onOff) UnmarshalText(text []byte) error { | |||
| 61 | 61 | case "off": | |
| 62 | 62 | *o = false | |
| 63 | 63 | default: | |
| 64 | - | return errors.New("must be on or off") | |
| 64 | + | return kvconf.ValueError("must be on or off") | |
| 65 | 65 | } | |
| 66 | 66 | return nil | |
| 67 | 67 | } | |
| @@ -71,10 +71,10 @@ type dirPath string | |||
| 71 | 71 | ||
| 72 | 72 | func (d *dirPath) UnmarshalText(text []byte) error { | |
| 73 | 73 | if len(text) > maxPath { | |
| 74 | - | return errors.New("must be a non-empty path") | |
| 74 | + | return kvconf.ValueError("must be a non-empty path") | |
| 75 | 75 | } | |
| 76 | 76 | if string(text) == "~" { | |
| 77 | - | return errors.New("must be an absolute path or start with ~/") | |
| 77 | + | return kvconf.ValueError("must be an absolute path or start with ~/") | |
| 78 | 78 | } | |
| 79 | 79 | var p kvconf.Path | |
| 80 | 80 | if err := p.UnmarshalText(text); err != nil { | |
| @@ -100,7 +100,7 @@ func Load() (Settings, error) { | |||
| 100 | 100 | return settings, nil | |
| 101 | 101 | case errors.Is(err, kvconf.ErrTooLarge): | |
| 102 | 102 | return Settings{}, fmt.Errorf("config %s exceeds %d bytes", path, maxBytes) | |
| 103 | - | case err != nil && strings.HasSuffix(err.Error(), "not a regular file"): | |
| 103 | + | case errors.Is(err, kvconf.ErrNotRegular): | |
| 104 | 104 | return Settings{}, fmt.Errorf("config %s: expected a regular file", path) | |
| 105 | 105 | case err != nil: | |
| 106 | 106 | return Settings{}, fmt.Errorf("read config: %w", err) | |
| @@ -61,7 +61,7 @@ func (o *onOff) UnmarshalText(text []byte) error { | |||||
| 61 | case "off": | 61 | case "off": | ||
| 62 | *o = false | 62 | *o = false | ||
| 63 | default: | 63 | default: | ||
| 64 | - | return errors.New("must be on or off") | 64 | + | return kvconf.ValueError("must be on or off") |
| 65 | } | 65 | } | ||
| 66 | return nil | 66 | return nil | ||
| 67 | } | 67 | } | ||
| @@ -71,10 +71,10 @@ type dirPath string | |||||
| 71 | 71 | ||||
| 72 | func (d *dirPath) UnmarshalText(text []byte) error { | 72 | func (d *dirPath) UnmarshalText(text []byte) error { | ||
| 73 | if len(text) > maxPath { | 73 | if len(text) > maxPath { | ||
| 74 | - | return errors.New("must be a non-empty path") | 74 | + | return kvconf.ValueError("must be a non-empty path") |
| 75 | } | 75 | } | ||
| 76 | if string(text) == "~" { | 76 | if string(text) == "~" { | ||
| 77 | - | return errors.New("must be an absolute path or start with ~/") | 77 | + | return kvconf.ValueError("must be an absolute path or start with ~/") |
| 78 | } | 78 | } | ||
| 79 | var p kvconf.Path | 79 | var p kvconf.Path | ||
| 80 | if err := p.UnmarshalText(text); err != nil { | 80 | if err := p.UnmarshalText(text); err != nil { | ||
| @@ -100,7 +100,7 @@ func Load() (Settings, error) { | |||||
| 100 | return settings, nil | 100 | return settings, nil | ||
| 101 | case errors.Is(err, kvconf.ErrTooLarge): | 101 | case errors.Is(err, kvconf.ErrTooLarge): | ||
| 102 | return Settings{}, fmt.Errorf("config %s exceeds %d bytes", path, maxBytes) | 102 | return Settings{}, fmt.Errorf("config %s exceeds %d bytes", path, maxBytes) | ||
| 103 | - | case err != nil && strings.HasSuffix(err.Error(), "not a regular file"): | 103 | + | case errors.Is(err, kvconf.ErrNotRegular): |
| 104 | return Settings{}, fmt.Errorf("config %s: expected a regular file", path) | 104 | return Settings{}, fmt.Errorf("config %s: expected a regular file", path) | ||
| 105 | case err != nil: | 105 | case err != nil: | ||
| 106 | return Settings{}, fmt.Errorf("read config: %w", err) | 106 | return Settings{}, fmt.Errorf("read config: %w", err) | ||