Collect some go functions with good performance and convenient.
like Stings and byte convertion. generator.
There is a better suggestion to match the validator package
go get github.com/slclub/utils
- strings writer@gin
- strings bytes convenient
- StringToBytes(s string) (b []byte) 0 allocs/op
- BytesToString(b []byte) string 0 allocs/op
- strings bytes convenient
import("github.com/slclub/utils/bytesconv")
- common
- IsUnix() bool
- EOL
example:
// linux "\n"
// windows "\r\n"
utils.EOL
example:
if utils.IsUnix() {
do something in unix
} else {
do something in windows.
}
-
generator number
-
reflect functions
-
HTTP url parseparam.