section: misc fix

[ci skip]
This commit is contained in:
Unknwon
2019-03-26 22:48:45 -04:00
parent 7ff51274eb
commit 3be5ad479f
2 changed files with 3 additions and 5 deletions
+1 -3
View File
@@ -106,7 +106,6 @@ func (s *Section) NewBooleanKey(name string) (*Key, error) {
// GetKey returns key in section by given name.
func (s *Section) GetKey(name string) (*Key, error) {
// FIXME: change to section level lock?
if s.f.BlockMode {
s.f.lock.RLock()
}
@@ -143,8 +142,7 @@ func (s *Section) HasKey(name string) bool {
return key != nil
}
// Haskey is a backwards-compatible name for HasKey.
// TODO: delete me in v2
// Deprecated: Use "HasKey" instead.
func (s *Section) Haskey(name string) bool {
return s.HasKey(name)
}
+2 -2
View File
@@ -151,9 +151,9 @@ func TestSection_HasKey(t *testing.T) {
So(k, ShouldNotBeNil)
So(f.Section("").HasKey("NAME"), ShouldBeTrue)
So(f.Section("").Haskey("NAME"), ShouldBeTrue)
So(f.Section("").HasKey("NAME"), ShouldBeTrue)
So(f.Section("").HasKey("404"), ShouldBeFalse)
So(f.Section("").HasKey("404"), ShouldBeFalse)
So(f.Section("").Haskey("404"), ShouldBeFalse)
})
}