When using the Go language, you may feel that time calculation, file processing, array operations, etc. often require a lot of time and code to complete, which is very inconvenient.
In order to solve this problem, all common complex underlying operations and business operations can be encapsulated into simple and easy-to-use APIs, and the most important thing is that these APIs are unified and standard, and conform to the Go interface specification.
So the golib project came into being.
Using go get
or go mod
the two ways to download this project. It is recommended to download the latest version.
go get github.com/WGrape/golib@latest
If you put the word latest in place of the tag in the go.mod
file it will get changed to the latest tag the modules.
module XXX
go 1.16
require (
github.com/WGrape/golib latest
)
After the download and import are successful, you can call the golib package
as follows.
The code is from matching project.
import "github.com/WGrape/golib/permutation"
// getCombinationList get the combination list of properties
func (strategy *UseStrategy) getCombinationList(propertyList []string) []string {
return permutation.GetCombinationsWithImplode(propertyList, ";")
}
Since this project consists of individual package
, there is almost no code reading cost. If you have better ideas, you are very welcome to join in and contribute. Please refer to Contribution Documentation on how to contribute.
package | description | api |
---|---|---|
safego | Package safego provides a series of security behaviors. | document |
permutation | Package permutation provides many algorithms about permutation and combination. | document |
http | The http package provides efficient and high-performance network operations. | document |
redis | Package redis provides advanced operations, such as Cache Penetration, Cache Breakdown, Cache Avalanche . |
document |
desensitization | Package desensitization provides data desensitization support. | document |
time | Package time provides functionality for measuring and displaying time more efficiently. | document |
array | Package array provides functionality for measuring and displaying array more efficiently. | document |
binary | Package binary provides some operations of binary number and decimal number. | document |
convert | Package convert provides simpler conversion between int, float, and string. | document |
set | Package set provides simpler set operations. | document |
rand | Package rand provides some random operations. | document |
math | Package math provides simpler math operations. | document |
system | Package system provides an interface to interact with the linux system. | document |
string | Package string provides an interface to process string in the simpler way. | document |
slice | Package slice provides an interface to process slice in the simpler way. | document |
frontend | Package frontend provides an interface to work with front-end colleagues in the simpler way. | document |