group_test.go ✅ test: structs,cli - add more unit test cases Jun 29, 2023 View all files Repository files navigation README MIT license Go Util 💪 Useful utils(700+) package for the Go: int, string, array/slice, map, error, time, format, CLI, ENV, filesystem, system, testing ...
Package validator implements value validations for structs and individual fields based on tags.It has the following unique features:Cross Field and Cross Struct validations by using validation tags or custom validators. Slice, Array and Map diving, which allows any or all levels of a multidimensional...
// source at arrutil/arrutil.gofuncReverse(ss []string)funcStringsRemove(ss []string, sstring)[]stringfuncTrimStrings(ss []string, cutSet ...string)(ns []string)funcGetRandomOne(arrinterface{})interface{}// source at arrutil/check.gofuncIntsHas(ints []int, valint)boolfuncInt64sHas(...
• Decode JSON with unknown structure • Access HTTP response as string in Go • How to search for an element in a golang slice • How to delete an element from a Slice in Golang • How to set default values in Go structs • MINGW64 "make build" error: "bash: make: comm...
Struct tag options (toarray,keyasint,omitempty,omitzero) reduce encoded size of structs. 🔎 Example encoding 3-level nested Go struct to 1 byte CBOR https://go.dev/play/p/YxwvfPdFQG2 // Example encoding nested struct (with omitempty tag)// - encoding/json: 18 byte JSON// - fxamac...
Package validator implements value validations for structs and individual fields based on tags. It has the following unique features: Cross Field and Cross Struct validations by using validation tags or custom validators. Slice, Array and Map diving, which allows any or all levels of a multidimensio...