Settings: Remove unnessary error handling code (#27420)

* Settings: Remove unnecessary error handling code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Torkel Ödegaard
2020-09-08 11:33:04 +02:00
committed by GitHub
co-authored by Arve Knudsen
parent 6fabfee097
commit 5c31f07904
3 changed files with 73 additions and 219 deletions
+2 -4
View File
@@ -279,14 +279,12 @@ func TestLoadingSettings(t *testing.T) {
So(err, ShouldBeNil)
Convey("If key is found - should return value from ini file", func() {
value, err := valueAsString(iniFile.Section("server"), "alt_url", "")
So(err, ShouldBeNil)
value := valueAsString(iniFile.Section("server"), "alt_url", "")
So(value, ShouldEqual, "https://grafana.com/")
})
Convey("If key is not found - should return default value", func() {
value, err := valueAsString(iniFile.Section("server"), "extra_url", "default_url_val")
So(err, ShouldBeNil)
value := valueAsString(iniFile.Section("server"), "extra_url", "default_url_val")
So(value, ShouldEqual, "default_url_val")
})
})