From 3be5ad479f69d4e08d7fe25edf79bf3346bd658e Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 26 Mar 2019 22:48:45 -0400 Subject: [PATCH] section: misc fix [ci skip] --- section.go | 4 +--- section_test.go | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/section.go b/section.go index 261788e..0bd3e13 100644 --- a/section.go +++ b/section.go @@ -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) } diff --git a/section_test.go b/section_test.go index fd5e43a..37da867 100644 --- a/section_test.go +++ b/section_test.go @@ -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) }) }