# README
go-modules
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
Returns the first element that meet the condition specified in a callback function.
Hash an array into a nested array
numArray := []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
splitArray := gm.HashArrayToArrays(numArray, 3)
fmt.Printf("new array: %v\n", splitArray)
Output: [[1 4 7 9] [2 5 10] [3 6 8]]
*/.
No description provided by the author
No description provided by the author
No description provided by the author
Calls a defined callback function on each element of an array, and returns an array that contains the results.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Get the hash value of the file
The effect is equivalent to the command line sha256sum
fileBytes, err := gm.ReadFileBytes("example.go")
if err != nil {
fmt.Printf("read file bytes err, msg: %v\n", err)
return
}
hash, err := gm.ReadFileHash(fileBytes)
if err != nil {
fmt.Printf("read file hash err, msg: %v\n", err)
return
}
fmt.Printf("hash: %v\n", hash)
-----------------------------------------------------
FILE_HASH=$(sha256sum example.go)
hash == FILE_HASH
*/.
Truncate the string, keep the beginning and ends, and add an ellipsis in the middle to truncate the string
*/.
Only add the element if it is not already in the slice
*/.
Validate JSON data and parse it into the specified structure.
Verify the structure.