Jelajahi Sumber

options.DeleteFromChildren -> options.DeleteFromDescendants

DarthSim 2 minggu lalu
induk
melakukan
a59d04bad0
2 mengubah file dengan 5 tambahan dan 5 penghapusan
  1. 3 3
      options/options.go
  2. 2 2
      options/options_test.go

+ 3 - 3
options/options.go

@@ -127,7 +127,7 @@ func (o *Options) Set(key string, value any) {
 	o.m[key] = value
 }
 
-// Propagate propagates a value under the given key to the child Options if any.
+// Propagate propagates a value under the given key to the Options descendants if any.
 func (o *Options) Propagate(key string) {
 	if o.child == nil {
 		return
@@ -154,8 +154,8 @@ func (o *Options) DeleteByPrefix(prefix string) {
 	}
 }
 
-// DeleteFromChildren removes an option by its key from the child Options if any.
-func (o *Options) DeleteFromChildren(key string) {
+// DeleteFromDescendants removes an option by its key from the Options descendants if any.
+func (o *Options) DeleteFromDescendants(key string) {
 	if o.child == nil {
 		return
 	}

+ 2 - 2
options/options_test.go

@@ -92,7 +92,7 @@ func (s *OptionsTestSuite) TestPropagate() {
 	s.Require().False(grandChild.Has("key3"))
 }
 
-func (s *OptionsTestSuite) TestDeleteFromChildren() {
+func (s *OptionsTestSuite) TestDeleteFromDescendants() {
 	o := New()
 	o.Set("key1", "value1")
 
@@ -104,7 +104,7 @@ func (s *OptionsTestSuite) TestDeleteFromChildren() {
 	grandChild.Set("key1", "grandchild_value1")
 	grandChild.Set("key2", 300)
 
-	o.DeleteFromChildren("key1")
+	o.DeleteFromDescendants("key1")
 
 	s.Require().Equal("value1", Get(o, "key1", ""))