Skip to content

Commit

Permalink
fix some wrong comment (#3265)
Browse files Browse the repository at this point in the history
  • Loading branch information
oldme-git authored Jan 16, 2024
1 parent 9407fda commit d26b7c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions container/gset/gset_z_example_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func ExampleIntSet_Add() {
fmt.Println(intSet.Slice())
fmt.Println(intSet.AddIfNotExist(1))

// Mya Output:
// May Output:
// [1 2 3]
// false
}
Expand All @@ -56,7 +56,7 @@ func ExampleIntSet_AddIfNotExist() {
fmt.Println(intSet.Slice())
fmt.Println(intSet.AddIfNotExist(1))

// Mya Output:
// May Output:
// [1 2 3]
// false
}
Expand Down
10 changes: 5 additions & 5 deletions container/gset/gset_z_example_str_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,27 @@ func ExampleStrSet_Add() {
fmt.Println(strSet.Slice())
fmt.Println(strSet.AddIfNotExist("str"))

// Mya Output:
// May Output:
// [str str1 str2 str3]
// false
}

// AddIfNotExist checks whether item exists in the set,
// it adds the item to set and returns true if it does not exists in the set,
// it adds the item to set and returns true if it does not exist in the set,
// or else it does nothing and returns false.
func ExampleStrSet_AddIfNotExist() {
strSet := gset.NewStrSetFrom([]string{"str1", "str2", "str3"}, true)
strSet.Add("str")
fmt.Println(strSet.Slice())
fmt.Println(strSet.AddIfNotExist("str"))

// Mya Output:
// May Output:
// [str str1 str2 str3]
// false
}

// AddIfNotExistFunc checks whether item exists in the set,
// it adds the item to set and returns true if it does not exists in the set and function `f` returns true,
// it adds the item to set and returns true if it does not exist in the set and function `f` returns true,
// or else it does nothing and returns false.
// Note that, the function `f` is executed without writing lock.
func ExampleStrSet_AddIfNotExistFunc() {
Expand All @@ -79,7 +79,7 @@ func ExampleStrSet_AddIfNotExistFunc() {
}

// AddIfNotExistFunc checks whether item exists in the set,
// it adds the item to set and returns true if it does not exists in the set and function `f` returns true,
// it adds the item to set and returns true if it does not exist in the set and function `f` returns true,
// or else it does nothing and returns false.
// Note that, the function `f` is executed without writing lock.
func ExampleStrSet_AddIfNotExistFuncLock() {
Expand Down

0 comments on commit d26b7c5

Please sign in to comment.