diff options
| author | mihna123 <mihailonvojinovic@gmail.com> | 2026-09-10 18:56:57 +0200 |
|---|---|---|
| committer | mihna123 <mihailonvojinovic@gmail.com> | 2026-09-10 18:56:57 +0200 |
| commit | 93e5765a09b464e5eb75afb23d7340ac7ad920da (patch) | |
| tree | 6cb0e97db13b1a8fb6e87c6152ad744e6596fcc0 | |
| parent | a5abfd1ce26438a5421a0494bab83c2805c09d6c (diff) | |
| download | openstore-93e5765a09b464e5eb75afb23d7340ac7ad920da.tar.gz openstore-93e5765a09b464e5eb75afb23d7340ac7ad920da.zip | |
config: fix the ErrBadConfig text and check err type in test
| -rw-r--r-- | internal/config/config.go | 2 | ||||
| -rw-r--r-- | internal/config/config_test.go | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index d212e1f..b73f3ba 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -35,7 +35,7 @@ type Config struct { } var ( - ErrBadConfig = errors.New("no database configuration found") + ErrBadConfig = errors.New("config is invalid") ErrBadConfigUrl = errors.New("bad url in config") ) diff --git a/internal/config/config_test.go b/internal/config/config_test.go index bc1ec37..39baa0b 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -169,6 +169,10 @@ func TetsRejectsConfigWithoutDatabase(t *testing.T) { if err == nil { t.Errorf("Load returned no error when database config is missing") } + + if !errors.Is(err, ErrBadConfig) { + t.Errorf("Got error %v, wanted %v", err, ErrBadConfig) + } } func TestDefaultPath(t *testing.T) { |
