Introduction
Array container that provides regular arrays and sorted arrays, supporting data item uniqueness correction and concurrency-safe toggle control.
Application Scenarios:
Array operations.
Usage:
import "github.com/gogf/gf/v2/container/garray"
Interface Documentation:
https://pkg.go.dev/github.com/gogf/gf/v2/container/garray
Brief Description:
- There are many objects and methods under the
garray
module, so it is recommended to look carefully at the interface documentation. garray
supports the three common data types:int
,string
,interface{}
.garray
supports both regular arrays and sorted arrays. The structure name of a regular array is defined in the format*Array
, and the structure name of a sorted array is defined in the formatSorted*Array
, as follows:Array
,intArray
,StrArray
SortedArray
,SortedIntArray
,SortedStrArray
- Among them, the sorted array
SortedArray
requires a given sorting comparison method, and manyComparator*
comparison methods are also defined in the toolkitgutil
.