utilityService

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainString

func ContainString(slice []string, item string) bool

----------------------------------------------------------------------------- ContainString - Checks if a slice contains a specific string -----------------------------------------------------------------------------

Parameters:

  • slice ([]string): The slice to check.
  • item (string): The string to look for in the slice.

Returns:

  • (bool): True if the slice contains the string, otherwise false.

-----------------------------------------------------------------------------

func ContainsString

func ContainsString(slice []string, item string) bool

----------------------------------------------------------------------------- ContainsString - Checks if a slice contains a specific string -----------------------------------------------------------------------------

Parameters:

  • slice ([]string): The slice to check.
  • item (string): The string to look for in the slice.

Returns:

  • (bool): True if the slice contains the string, otherwise false.

-----------------------------------------------------------------------------

func Max

func Max(x, y int) int

----------------------------------------------------------------------------- Max - Calculates the maximum of two integers -----------------------------------------------------------------------------

Parameters:

  • x (int): The first integer.
  • y (int): The second integer.

Returns:

  • (int): The maximum of the two integers.

-----------------------------------------------------------------------------

func Min

func Min(x, y int) int

----------------------------------------------------------------------------- Min - Calculates the minimum of two integers -----------------------------------------------------------------------------

Parameters:

  • x (int): The first integer.
  • y (int): The second integer.

Returns:

  • (int): The minimum of the two integers.

-----------------------------------------------------------------------------

Types

type OrderedSet

type OrderedSet struct {
	// contains filtered or unexported fields
}

func NewOrderedSet

func NewOrderedSet() *OrderedSet

----------------------------------------------------------------------------- NewOrderedSet - Creates a new instance of OrderedSet -----------------------------------------------------------------------------

Parameters:

  • None

Returns:

  • (*OrderedSet): A pointer to the newly created OrderedSet.

-----------------------------------------------------------------------------

func (*OrderedSet) Add

func (s *OrderedSet) Add(item string)

----------------------------------------------------------------------------- Add - Adds a string to the OrderedSet if it is not already present -----------------------------------------------------------------------------

Parameters:

  • item (string): The string to add to the OrderedSet.

Returns:

  • None

-----------------------------------------------------------------------------

func (*OrderedSet) Contains

func (s *OrderedSet) Contains(item string) bool

----------------------------------------------------------------------------- Contains - Checks if the OrderedSet contains a specific string -----------------------------------------------------------------------------

Parameters:

  • item (string): The string to check for in the OrderedSet.

Returns:

  • (bool): True if the OrderedSet contains the string, otherwise false.

-----------------------------------------------------------------------------

func (*OrderedSet) Items

func (s *OrderedSet) Items() []string

----------------------------------------------------------------------------- Items - Returns all items in the OrderedSet in the order they were added -----------------------------------------------------------------------------

Parameters:

  • None

Returns:

  • ([]string): A slice of strings containing all items in the OrderedSet.

-----------------------------------------------------------------------------

func (*OrderedSet) Remove

func (s *OrderedSet) Remove(item string)

----------------------------------------------------------------------------- Remove - Removes a string from the OrderedSet if it is present -----------------------------------------------------------------------------

Parameters:

  • item (string): The string to remove from the OrderedSet.

Returns:

  • None

-----------------------------------------------------------------------------

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL