Skip to content

Commit

Permalink
updated docstrings
Browse files Browse the repository at this point in the history
updated docstrings describing Set interface methods to start with a method name for a correct documentation generation (and avoiding tons of warnings in goland)
  • Loading branch information
flrdv authored and deckarep committed Mar 5, 2023
1 parent 2f79c69 commit bc8f6ad
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions set.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,26 @@ package mapset
// represents an unordered set of data and a large number of
// operations that can be applied to that set.
type Set[T comparable] interface {
// Adds an element to the set. Returns whether
// Add adds an element to the set. Returns whether
// the item was added.
Add(val T) bool

// Returns the number of elements in the set.
// Cardinality returns the number of elements in the set.
Cardinality() int

// Removes all elements from the set, leaving
// Clear removes all elements from the set, leaving
// the empty set.
Clear()

// Returns a clone of the set using the same
// Clone returns a clone of the set using the same
// implementation, duplicating all keys.
Clone() Set[T]

// Returns whether the given items
// Contains returns whether the given items
// are all in the set.
Contains(val ...T) bool

// Returns the difference between this set
// Difference returns the difference between this set
// and other. The returned set will contain
// all elements of this set that are not also
// elements of other.
Expand All @@ -69,7 +69,7 @@ type Set[T comparable] interface {
// panic.
Difference(other Set[T]) Set[T]

// Determines if two sets are equal to each
// Equal determines if two sets are equal to each
// other. If they have the same cardinality
// and contain the same elements, they are
// considered equal. The order in which
Expand All @@ -80,7 +80,7 @@ type Set[T comparable] interface {
// method. Otherwise, Equal will panic.
Equal(other Set[T]) bool

// Returns a new set containing only the elements
// Intersect returns a new set containing only the elements
// that exist only in both sets.
//
// Note that the argument to Intersect
Expand All @@ -89,7 +89,7 @@ type Set[T comparable] interface {
// panic.
Intersect(other Set[T]) Set[T]

// Determines if every element in this set is in
// IsProperSubset determines if every element in this set is in
// the other set but the two sets are not equal.
//
// Note that the argument to IsProperSubset
Expand All @@ -98,7 +98,7 @@ type Set[T comparable] interface {
// will panic.
IsProperSubset(other Set[T]) bool

// Determines if every element in the other set
// IsProperSuperset determines if every element in the other set
// is in this set but the two sets are not
// equal.
//
Expand All @@ -108,7 +108,7 @@ type Set[T comparable] interface {
// panic.
IsProperSuperset(other Set[T]) bool

// Determines if every element in this set is in
// IsSubset determines if every element in this set is in
// the other set.
//
// Note that the argument to IsSubset
Expand All @@ -117,7 +117,7 @@ type Set[T comparable] interface {
// panic.
IsSubset(other Set[T]) bool

// Determines if every element in the other set
// IsSuperset determines if every element in the other set
// is in this set.
//
// Note that the argument to IsSuperset
Expand All @@ -126,26 +126,26 @@ type Set[T comparable] interface {
// panic.
IsSuperset(other Set[T]) bool

// Iterates over elements and executes the passed func against each element.
// Each iterates over elements and executes the passed func against each element.
// If passed func returns true, stop iteration at the time.
Each(func(T) bool)

// Returns a channel of elements that you can
// Iter returns a channel of elements that you can
// range over.
Iter() <-chan T

// Returns an Iterator object that you can
// Iterator returns an Iterator object that you can
// use to range over the set.
Iterator() *Iterator[T]

// Remove a single element from the set.
// Remove removes a single element from the set.
Remove(i T)

// Provides a convenient string representation
// String provides a convenient string representation
// of the current state of the set.
String() string

// Returns a new set with all elements which are
// SymmetricDifference returns a new set with all elements which are
// in either this set or the other set but not in both.
//
// Note that the argument to SymmetricDifference
Expand All @@ -154,7 +154,7 @@ type Set[T comparable] interface {
// will panic.
SymmetricDifference(other Set[T]) Set[T]

// Returns a new set with all elements in both sets.
// Union returns a new set with all elements in both sets.
//
// Note that the argument to Union must be of the
// same type as the receiver of the method.
Expand All @@ -164,7 +164,7 @@ type Set[T comparable] interface {
// Pop removes and returns an arbitrary item from the set.
Pop() (T, bool)

// Returns the members of the set as a slice.
// ToSlice returns the members of the set as a slice.
ToSlice() []T

// MarshalJSON will marshal the set into a JSON-based representation.
Expand Down

0 comments on commit bc8f6ad

Please sign in to comment.