mirror of
https://github.com/go-ini/ini.git
synced 2026-06-19 21:46:45 +02:00
section: misc fix
[ci skip]
This commit is contained in:
+1
-3
@@ -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
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user