diff --git a/viper_test.go b/viper_test.go index 02d6eb1..c04b5f8 100644 --- a/viper_test.go +++ b/viper_test.go @@ -966,6 +966,18 @@ func BenchmarkGetBool(b *testing.B) { } } +func BenchmarkGet(b *testing.B) { + key := "BenchmarkGet" + v = New() + v.Set(key, true) + + for i := 0; i < b.N; i++ { + if !v.Get(key).(bool) { + b.Fatal("Get returned false") + } + } +} + // This is the "perfect result" for the above. func BenchmarkGetBoolFromMap(b *testing.B) { m := make(map[string]bool)