diff options
| author | xengineering <me@xengineering.eu> | 2025-12-20 14:15:58 +0100 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2025-12-20 14:15:58 +0100 |
| commit | d429f3a7dbe8fc8cc43ebe565b6130b1cfce4ea1 (patch) | |
| tree | f00d0911850110b983a1648342cc0646c90e9b6c /config_test.go | |
| parent | 224d52d1033d8ccce5087c9bee5a63457830a13a (diff) | |
| download | sia-server-d429f3a7dbe8fc8cc43ebe565b6130b1cfce4ea1.tar sia-server-d429f3a7dbe8fc8cc43ebe565b6130b1cfce4ea1.tar.zst sia-server-d429f3a7dbe8fc8cc43ebe565b6130b1cfce4ea1.zip | |
Add StartupConfiguration.Validate()
This method makes it easy to validate a configuration.
A call of it is now embedded into the StartupConfiguration.FromJSON()
method which should always be the lowest level function to parse
configurations.
Thus configurations can usually be trusted.
Diffstat (limited to 'config_test.go')
| -rw-r--r-- | config_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/config_test.go b/config_test.go index c568a34..0972d5d 100644 --- a/config_test.go +++ b/config_test.go @@ -11,4 +11,9 @@ func TestDefaultConfig(t *testing.T) { if err != nil { t.Fatalf("Failed parsing default config from JSON: %v", err) } + + err = config.Validate() + if err != nil { + t.Fatalf("Failed to validate default config: %v", err) + } } |
