A comprehensive, efficient, and reusable util function library of go.

Related tags

Utilities lancet
Overview

Lancet

Lancet is a comprehensive, efficient, and reusable util function library of go. Inspired by the java apache common package and lodash.js.

English | 简体中文

Feature

  • 👏 Comprehensive, efficient and reusable.
  • 💪 100+ common go util functions, support string, slice, datetime, net, crypt...
  • 💅 Only depend on the go standard library.
  • 🌍 Unit test for exery exported function.

Installation

go get github.com/duke-git/lancet

Usage

Lancet organizes the code into package structure, and you need to import the corresponding package name when use it. For example, if you use string-related functions,import the strutil package like below:

import "github.com/duke-git/lancet/strutil"

Example

Here takes the string function ReverseStr (reverse order string) as an example, and the strutil package needs to be imported.

package main

import (
    "fmt"
    "github.com/duke-git/lancet/strutil"
)

func main() {
    s := "hello"
    rs := strutil.ReverseStr(s)
    fmt.Println(rs) //olleh
}

API Documentation

1. convertor contains some functions for data convertion.

  • Support conversion between commonly used data types.
  • Usage: import "github.com/duke-git/lancet/cryptor"
package main

import (
    "fmt"
    "github.com/duke-git/lancet/convertor"
)

func main() {
    s := "12.3"
    f, err := convertor.ToFloat(s)
    if err != nil {
        fmt.Errorf("error is %s", err.Error())
    }
    fmt.Println(f) // 12.3
}
  • Function list:
func ColorHexToRGB(colorHex string) (red, green, blue int) //convert color hex to color rgb
func ColorRGBToHex(red, green, blue int) string //convert color rgb to color hex
func ToBool(s string) (bool, error)  //convert string to a boolean
func ToBytes(data interface{}) ([]byte, error) //convert interface to bytes
func ToChar(s string) []string //convert string to char slice
func ToFloat(value interface{}) (float64, error) //convert value to float64, if input is not a float return 0.0 and error
func ToInt(value interface{}) (int64, error) //convert value to int64, if input is not a numeric format return 0 and error
func ToJson(value interface{}) (string, error) //convert value to a valid json string
func ToString(value interface{}) string //convert value to string
func StructToMap(value interface{}) (map[string]interface{}, error) //convert struct to map, only convert exported field, tag `json` should be set

2. cryptor is for data encryption and decryption.

  • Support md5, hmac, aes, des, ras.
  • Usage: import "github.com/duke-git/lancet/cryptor"
package main

import (
    "fmt"
    "github.com/duke-git/lancet/cryptor"
)

func main() {
    data := "hello"
    key := "abcdefghijklmnop"

    encrypted := cryptor.AesCbcEncrypt([]byte(data), []byte(key))
    decrypted := cryptor.AesCbcDecrypt(encrypted, []byte(key))
    fmt.Println(string(decrypted)) // hello
}
  • Function list:
func AesEcbEncrypt(data, key []byte) []byte //AES ECB encrypt
func AesEcbDecrypt(encrypted, key []byte) []byte //AES ECB decrypt
func AesCbcEncrypt(data, key []byte) []byte //AES CBC encrypt
func AesCbcDecrypt(encrypted, key []byte) []byte //AES CBC decrypt
func AesCtrCrypt(data, key []byte) []byte //AES CTR encrypt / decrypt
func AesCfbEncrypt(data, key []byte) []byte //AES CFB encrypt
func AesCfbDecrypt(encrypted, key []byte) []byte //AES CFB decrypt
func AesOfbEncrypt(data, key []byte) []byte //AES OFB encrypt
func AesOfbDecrypt(data, key []byte) []byte //AES OFB decrypt
func Base64StdEncode(s string) string //base64 encode
func Base64StdDecode(s string) string //base64 decode
func DesCbcEncrypt(data, key []byte) []byte //DES CBC encrypt
func DesCbcDecrypt(encrypted, key []byte) []byte //DES CBC decrypt
func DesCtrCrypt(data, key []byte) []byte //DES CTR encrypt/decrypt
func DesCfbEncrypt(data, key []byte) []byte //DES CFB encrypt
func DesCfbDecrypt(encrypted, key []byte) []byte //DES CFB decrypt
func DesOfbEncrypt(data, key []byte) []byte //DES OFB encrypt
func DesOfbDecrypt(data, key []byte) []byte //DES OFB decrypt
func HmacMd5(data, key string) string //get hmac md5 value
func HmacSha1(data, key string) string //get hmac sha1 value
func HmacSha256(data, key string) string //get hmac sha256 value
func HmacSha512(data, key string) string //get hmac sha512 value
func Sha1(data string) string //get sha1 value
func Sha256(data string) string //getsha256 value
func Sha512(data string) string //get sha512 value
func GenerateRsaKey(keySize int, priKeyFile, pubKeyFile string) //generate RSA pem file
func RsaEncrypt(data []byte, pubKeyFileName string) []byte //RSA encrypt
func RsaDecrypt(data []byte, privateKeyFileName string) []byte //RSA decrypt

3. datetime parse and format datetime

  • Parse and format datetime
  • Usage: import "github.com/duke-git/lancet/datetime"
package main

import (
    "fmt"
    "github.com/duke-git/lancet/datetime"
)

func main() {
    now := time.Now()
    s := datetime.FormatTimeToStr(now, "yyyy-mm-dd hh:mm:ss")
    fmt.Println(s) // 2021-11-24 11:16:55
}
  • Function list:
func AddDay(t time.Time, day int64) time.Time //add or sub days to time
func AddHour(t time.Time, hour int64) time.Time //add or sub hours to time
func AddMinute(t time.Time, minute int64) time.Time //add or sub minutes to time
func GetNowDate() string  //get current date, format is yyyy-mm-dd
func GetNowTime() string //get current time, format is hh:mm:ss
func GetNowDateTime() string //get current date and time, format is yyyy-mm-dd hh:mm:ss
func GetZeroHourTimestamp() int64 //return timestamp of zero hour (timestamp of 00:00)
func GetNightTimestamp() int64 //return timestamp of zero hour (timestamp of 23:59)
func FormatTimeToStr(t time.Time, format string) string //convert time to string
func FormatStrToTime(str, format string) time.Time //convert string to time

4. fileutil basic functions for file operations

  • Basic functions for file operations.
  • Usage: import "github.com/duke-git/lancet/fileutil"
package main

import (
    "fmt"
    "github.com/duke-git/lancet/fileutil"
)

func main() {
    fmt.Println(fileutil.IsDir("./")) // true
}
  • 函数列表:
func CreateFile(path string) bool // create a file in path
func CopyFile(srcFilePath string, dstFilePath string) error //copy src file to dst file
func IsExist(path string) bool  //checks if a file or directory exists
func IsDir(path string) bool //checks if the path is directy or not
func ListFileNames(path string) ([]string, error) //return all file names in the path
func RemoveFile(path string) error //remove the path file

5. formatter is for data format

  • Contain some formatting function
  • Usage: import "github.com/duke-git/lancet/formatter"
package main

import (
    "fmt"
    "github.com/duke-git/lancet/formatter"
)

func main() {
     fmt.Println(formatter.Comma("12345", ""))   // "12,345"
     fmt.Println(formatter.Comma(12345.67, "¥")) // "¥12,345.67"
}
  • Function list:
func Comma(v interface{}, symbol string) string  //add comma to number by every 3 numbers from right. ahead by symbol char

6. netutil is for net process

  • Ip and http request method.
  • Usage: import "github.com/duke-git/lancet/netutil".
  • The Http function params order:url, header, query string, body, httpclient.
package main

import (
    "fmt"
    "io/ioutil"
    "log"
    "github.com/duke-git/lancet/netutil"
)

func main() {
    url := "https://gutendex.com/books?"
    header := make(map[string]string)
    header["Content-Type"] = "application/json"
    queryParams := make(map[string]interface{})
    queryParams["ids"] = "1"

    resp, err := netutil.HttpGet(url, header, queryParams)
    if err != nil {
       log.Fatal(err)
    }

    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println("response: ", resp.StatusCode, string(body))
}
  • Function list:
func GetInternalIp() string //get internal ip
func GetPublicIpInfo() (*PublicIpInfo, error) //get public ip info: country, region, isp, city, lat, lon, ip
func IsPublicIP(IP net.IP) bool //判断ip是否为公共ip
func HttpGet(url string, params ...interface{}) (*http.Response, error) //http get request
func HttpPost(url string, params ...interface{}) (*http.Response, error) //http post request
func HttpPut(url string, params ...interface{}) (*http.Response, error) //http put request
func HttpDelete(url string, params ...interface{}) (*http.Response, error) //http delete request
func HttpPatch(url string, params ...interface{}) (*http.Response, error) //http patch request
func ConvertMapToQueryString(param map[string]interface{}) string //convert map to url query string

7. random is for rand string and int generation.

  • Generate random string and int.
  • Usage: import "github.com/duke-git/lancet/random".
package main

import (
    "fmt"
    "io/ioutil"
    "log"
    "github.com/duke-git/lancet/random"
)

func main() {
    randStr := random.RandString(6)
    fmt.Println(randStr)
}
  • Function list:
func RandBytes(length int) []byte //generate random []byte
func RandInt(min, max int) int //generate random int
func RandString(length int) string //generate random string

8. slice is for process slice

  • Contain function for process slice.
  • Usage: import "github.com/duke-git/lancet/slice"
  • Due to the unstable support of generic, most of the slice processing function parameter and return value is interface {}. After go generic is stable, the related functions will be refactored.
package main

import (
    "fmt"
    "io/ioutil"
    "log"
    "github.com/duke-git/lancet/slice"
)

func main() {
    nums := []int{1, 4, 3, 4, 6, 7, 3}
    uniqueNums, _ := slice.IntSlice(slice.Unique(nums))
    fmt.Println(uniqueNums) //[1 4 3 6 7]
}
  • Function list:
func Contain(slice interface{}, value interface{}) bool //check if the value is in the slice or not
func Chunk(slice []interface{}, size int) [][]interface{} //creates an slice of elements split into groups the length of `size`.
func ConvertSlice(originalSlice interface{}, newSliceType reflect.Type) interface{} //convert originalSlice to newSliceType
func Difference(slice1, slice2 interface{}) interface{} //creates an slice of whose element not included in the other given slice
func DeleteByIndex(slice interface{}, start int, end ...int) (interface{}, error) //delete the element of slice from start index to end index - 1
func Filter(slice, function interface{}) interface{} //filter slice, function signature should be func(index int, value interface{}) bool
func IntSlice(slice interface{}) ([]int, error) //convert value to int slice
func InterfaceSlice(slice interface{}) []interface{} //convert value to interface{} slice
func InsertByIndex(slice interface{}, index int, value interface{}) (interface{}, error) //insert the element into slice at index.
func Map(slice, function interface{}) interface{} //map lisce, function signature should be func(index int, value interface{}) interface{}
func ReverseSlice(slice interface{}) //revere slice
func Reduce(slice, function, zero interface{}) interface{} //reduce slice, function signature should be func(index int, value1, value2 interface{}) interface{}
func SortByField(slice interface{}, field string, sortType ...string) error //sort struct slice by field
func StringSlice(slice interface{}) []string //convert value to string slice
func Unique(slice interface{}) interface{} //remove duplicate elements in slice
func UpdateByIndex(slice interface{}, index int, value interface{}) (interface{}, error) //update the slice element at index.

9. strutil is for processing string

  • Contain functions to precess string
  • Usage: import "github.com/duke-git/lancet/strutil"
package main

import (
    "fmt"
    "io/ioutil"
    "log"
    "github.com/duke-git/lancet/strutil"
)

func main() {
    str := "Foo-Bar"
    camelCaseStr := strutil.CamelCase(str)
    fmt.Println(camelCaseStr) //fooBar
}
  • Function list:
func After(s, char string) string //create substring in source string after position when char first appear
func AfterLast(s, char string) string //create substring in source string after position when char last appear
func Before(s, char string) string //create substring in source string before position when char first appear
func BeforeLast(s, char string) string //create substring in source string before position when char last appear
func CamelCase(s string) string //covert string to camelCase string. "foo bar" -> "fooBar"
func Capitalize(s string) string //convert the first character of a string to upper case, "fOO" -> "Foo"
func IsString(v interface{}) bool //check if the value data type is string or not
func KebabCase(s string) string //covert string to kebab-case, "foo_Bar" -> "foo-bar"
func LowerFirst(s string) string //convert the first character of string to lower case
func PadEnd(source string, size int, padStr string) string //pads string on the right side if it's shorter than size
func PadStart(source string, size int, padStr string) string//pads string on the left side if it's shorter than size
func ReverseStr(s string) string //return string whose char order is reversed to the given string
func SnakeCase(s string) string //covert string to snake_case "fooBar" -> "foo_bar"

10. validator is for data validation

  • Contain function for data validation.
  • Usage: import "github.com/duke-git/lancet/validator".
package main

import (
    "fmt"
    "io/ioutil"
    "log"
    "github.com/duke-git/lancet/validator"
)

func main() {
    str := "Foo-Bar"
    isAlpha := validator.IsAlpha(str)
    fmt.Println(isAlpha) //false
}
  • Function list:
func ContainChinese(s string) bool //check if the string contain mandarin chinese
func IsAlpha(s string) bool //checks if the string contains only letters (a-zA-Z)
func IsBase64(base64 string) bool //check if the string is base64 string
func IsChineseMobile(mobileNum string) bool //check if the string is chinese mobile number
func IsChineseIdNum(id string) bool //check if the string is chinese id number
func IsChinesePhone(phone string) bool //check if the string is chinese phone number
func IsCreditCard(creditCart string) bool //check if the string is credit card
func IsDns(dns string) bool //check if the string is dns
func IsEmail(email string) bool //check if the string is a email address
func IsEmptyString(s string) bool //check if the string is empty
func IsFloatStr(s string) bool //check if the string can convert to a float
func IsNumberStr(s string) bool //check if the string can convert to a number
func IsRegexMatch(s, regex string) bool //check if the string match the regexp
func IsIntStr(s string) bool //check if the string can convert to a integer
func IsIp(ipstr string) bool //check if the string is a ip address
func IsIpV4(ipstr string) bool //check if the string is a ipv4 address
func IsIpV6(ipstr string) bool //check if the string is a ipv6 address
func IsStrongPassword(password string, length int) bool //check if the string is strong password (alpha(lower+upper) + number + special chars([email protected]#$%^&*()?><))
func IsWeakPassword(password string) bool //check if the string is weak password(only letter or only number or letter + number)
Comments
  • Slice: Add GroupBy func

    Slice: Add GroupBy func

    Group by: split slice into two groups, applies on each slice element a predicate func to categorize this element.

    Changes

    • Add groub by func
    • Add test case for this func
    opened by donutloop 7
  • feat: type conversion function adds support for decimal types

    feat: type conversion function adds support for decimal types

    I think decimal is a very important type, and it would be great to support decimal. So I made the conversion related methods compatible with decimal types. Now, we can convert any value to a decimal type through the ToDecimal method, and we can convert a decimal type to any other type. eg.

    number := ToDecimal("123.321")
    fmt.Prantln(number)
    
    opened by Mickls 6
  • 建议netutil优化一下将Body的读取和json序列化也做进去

    建议netutil优化一下将Body的读取和json序列化也做进去

    resp, err := netutil.HttpPost(url, header, queryParams)
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	body, _ := ioutil.ReadAll(resp.Body)
    	var info MyInfo
    	err = json.Unmarshal(body, &info)
    	if err != nil {
    		log.Fatal(err.Error())
    		return
    	}
    
    • 这个是目前的HTTP请求方式,可以新增一个解析方法将结构体传入返回对应的数据感觉更好吧
    • 当然这个应该是独立的方法,有可能存在有些人并不是使用结构体进行解析
    opened by uouuou 4
  • maputil: IsDisjoint

    maputil: IsDisjoint

    Verifies map a and map b have no keys in common.

    if it returns true then the maps are disjoint otherwise a join in some form available

    Note: I did not added translation for CN

    opened by donutloop 3
  • Slice: find nothing case

    Slice: find nothing case

    The current behavior can result into wired edge cases.

    Current behavior

    if find was unsuccessfully then it will return the first element of the slice

    Desired behavior

    if find was unsuccessfully then it should return negative ok and a none value

    opened by donutloop 3
  • Slice: Optimize slice func tools

    Slice: Optimize slice func tools

    IntSlice and StringSlice: preallocate memory up front for output slice. Instead returning a error throw a panic because most likely it's a programming error. Contain: rename slice to iterableType and add default case for type mismatches

    opened by donutloop 3
  • slice chunk的坑

    slice chunk的坑

    package main
    
    import (
    	"fmt"
    
    	"github.com/duke-git/lancet/v2/slice"
    	"github.com/samber/lo"
    )
    
    func main() {
    	arr := []string{"a", "b", "c"}
    	fmt.Println(slice.Chunk(arr, 10))
    	fmt.Println(lo.Chunk(arr, 10))
    }
    

    输出

    [[a] [b] [c]]
    
    [[a b c]]
    

    当chunk长度大于slice长度时,lo库的处理逻辑是正确的

    opened by feeops 2
  • list: Add LastIndexOfFunc and IndexOfFunc method

    list: Add LastIndexOfFunc and IndexOfFunc method

    • LastIndexOfFunc returns the index of the last occurrence of the value in this list satisfying f(data[i])
    • IndexOfFunc returns the first index satisfying f(v)
    opened by donutloop 2
  • HTTP methods do not have a way to set a timeout

    HTTP methods do not have a way to set a timeout

    Functions that make HTTP requests should accept context for cancellation. Even worse, an http client with default options is used. Not only it doesn't have any timeouts, creating a new HTTP client for every single request isn't efficient and would not utilise HTTP "keep alive" mechanics.

    opened by dobegor 2
Releases(v2.1.13)
  • v2.1.13(Jan 8, 2023)

    Feature:

    Strutil package: add Substring function. Concurrency package: add generic support for channel functions.

    Doc&Test:

    Test: add examples and playground demo for all functions. Doc: update document for all packages.

    Source code(tar.gz)
    Source code(zip)
  • v2.1.12(Dec 15, 2022)

    Feature:

    1. Strutil package: add new functions, UpperKebabCase, UpperSnakeCase.
    2. Validator package: add new function IsGBK.

    Fix:

    1. System package: ExecCommand function bug in windows.
    2. All go lint issues.
    Source code(tar.gz)
    Source code(zip)
  • v1.3.5(Dec 15, 2022)

    Feature:

    1. Strutil package: add new functions, UpperKebabCase, UpperSnakeCase.
    2. Validator package: add new function IsGBK.

    Fix:

    1. System package: ExecCommand function bug in windows.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.11(Dec 4, 2022)

    Feature:

    1. Slice package: add new functions, Merge, Repeat, Sort, SortBy, Count, CountBy.
    2. Datastructure/set: add new functions NewSetFromSlice, AddIfNotExist, AddIfNotExistBy.

    Fix:

    1. Slice package: fix logic bug of Chunk slice.

    Deprecated:

    1. Slice package: deprecate functions SortByField, InterfaceSlice, IntSlice, StringSlice.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.10(Nov 17, 2022)

  • v1.3.4(Nov 17, 2022)

  • v2.1.9(Nov 8, 2022)

    Feature:

    1. Add new functions in random package: RandUpper, RandLower, RandNumeral, RandNumeralOrLetter.
    2. Add KeyBy and UnionBy in slice package.
    Source code(tar.gz)
    Source code(zip)
  • v1.3.3(Nov 8, 2022)

  • v2.1.8(Oct 21, 2022)

    Feature:

    1. Add Pipeline in function/function.go.
    2. Add Replace and ReplaceAll in slice/slice.go.
    3. Support type alias for Number constraint (lancetconstraints/constraints.go).
    Source code(tar.gz)
    Source code(zip)
  • v2.1.7(Oct 14, 2022)

  • v2.1.6(Aug 31, 2022)

    Feature:

    1. Add new http client implementation, see netutil/http_client.go
    2. Add condition package for conditional judgment, see condition/condition.go
    3. Add function EncodeByte and DecodeByte, see convertor/convertor.go
    4. Add function IsZeroValue, see validator/validator.go

    Fix:

    1. Fix hash algorithm bug in datastructure/HashMap.go
    Source code(tar.gz)
    Source code(zip)
  • v1.3.2(Aug 31, 2022)

    Feature:

    1. Add new http client implementation, see netutil/http_client.go
    2. Add function EncodeByte and DecodeByte, see convertor/convertor.go
    3. Add function IsZeroValue, see validator/validator.go
    Source code(tar.gz)
    Source code(zip)
  • v2.1.5(Aug 25, 2022)

  • v2.1.4(Aug 3, 2022)

  • v1.3.1(Aug 3, 2022)

    Feature:

    1. slice: ToSlice, ToSlicePointer, AppendIfAbsent.
    2. net: IsInternalIP, GetRequestPublicIp, EncodeUrl.
    3. convertor: ToChannel.
    4. system: GetOsBits.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.3(Jul 21, 2022)

    Feature:

    1. slice: Flatten
    2. map: IsDisjoint
    3. system: GetOsBits

    Fix:

    1. aes.go: fix iv generation algorithm in functions: AesCbcEncrypt, AesCbcDecrypt
    2. des.go: fix iv generation algorithm in functions: DesCbcEncrypt, DesCbcDecrypt
    Source code(tar.gz)
    Source code(zip)
  • v2.1.2(Jul 13, 2022)

    Feature:

    1. convertor: ToChannel, ToMap, MapToSlice, ToPointer
    2. slice: ToSlice, ToSlicePointer,
    3. netutil: GetRequestPublicIp, IsInternalIP

    Refactor:

    1. Change some slice functions param type: any->comparable

    Fix:

    1. netutil: fix post request multipart header bug.
    2. fileutil: fix some unit tests run failed.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.1(Jul 6, 2022)

    Feature:

    1. Add MaxHeap data structure in package datastructure.
    2. Add ToSlice and ToSlicePointer functions in package slice.
    3. Add ToPointer function in package convertor.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Jun 22, 2022)

  • v1.3.0(Jun 22, 2022)

    Feature:

    1. Add CreateDir function for create directory in fileutil/file.go
    2. Add IndexOf, LastIndexOf, UniqueBy, Equal and EqualWith functions in slice/slice.go
    3. Add SplitEx function in string/str.go
    Source code(tar.gz)
    Source code(zip)
  • v2.0.9(Jun 15, 2022)

  • v2.0.8(Jun 7, 2022)

  • v2.0.7(May 18, 2022)

  • v2.0.6(May 12, 2022)

  • v2.0.5(Apr 24, 2022)

  • v2.0.4(Apr 14, 2022)

  • v1.2.9(Apr 14, 2022)

  • v1.2.8(Apr 13, 2022)

  • v2.0.3(Apr 6, 2022)

    Feature:

    1. Add maputil package.
    2. Add SymmetricDifference function in slice package.
    3. Add SymmetricDifference, Minus functions in datastructure package set.go.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.2(Mar 29, 2022)

    Feature:

    1. datastructure/link/singlylink.go add DeleteValue func

    Fix:

    1. convertor/convertor.go ToBytes func bug.
    2. algorithm/sorter.go InsertionSort func bug.
    Source code(tar.gz)
    Source code(zip)
Owner
Beyond
Focus on golang, javascript
Beyond
Goterators - A util library that Supports aggregate & transforms functions Go. Such as filter, map, reduce, find, exist

Goterators Goterators is util library that Supports aggregate & transforms functions Go, including: for-each find exist reduce filter map API and func

Thuc Le 98 Dec 19, 2022
A comprehensive list of alternatives to your favorite software

alternativeto A comprehensive list of alternatives to your favorite software. Please do not edit this file directly. Instead, follow the steps outline

Brent Adamson 33 Jun 16, 2022
redis-util business-friendly encapsulation of redis operations, such as the common cache set get operation

redis-util 方便业务使用的redis操作封装,比如常见的缓存set get操作, 一行代码搞定,不像开源库需要写好多行 使用方法

connor 1 Oct 22, 2021
Molecule is a Go library for parsing protobufs in an efficient and zero-allocation manner

Molecule Molecule is a Go library for parsing protobufs in an efficient and zero-allocation manner. The API is loosely based on this excellent Go JSON

Richard Artoul 376 Jan 5, 2023
Helper library for full uint64 randomness, pool backed for efficient concurrency

fastrand64-go Helper library for full uint64 randomness, pool backed for efficient concurrency Inspired by https://github.com/valyala/fastrand which i

Ryan Haksi 41 Dec 5, 2021
A program to create assembly 8086 strings to print without using any printing/strings related function but only mov-xchg-int and loops

Assembly String builder tool A program to create assembly 8086 strings to print without using any printing/strings related function but only mov-xchg-

Reg 2 Feb 1, 2022
Cpu-profiling - Basic example of CPU Profiling in Golang which shows the bottlenecks and how much time is spent per function

cpu-profiling Basic example of CPU Profiling in Golang which shows the bottlenec

Felipe Azevedo 0 Aug 2, 2022
MCsniperGO, a fast, efficient, and feature-packed minecraft name sniper.

MCsniperGO This project was made possible by my donators Usage This sniper is in it's beta stage, meaning bugs should be expected. Easy installation d

Kqzz 125 Dec 31, 2022
Reload Go code in a running process at function/method level granularity

got reload? Function/method-level stateful hot reloading for Go! Status Very much work in progress.

null 34 Nov 9, 2022
keeper is package for Go that provides a mechanism for waiting a result of execution function until context cancel.

keeper is package for Go that provides a mechanism for waiting a result of execution function until context cancel.

Gunosy 5 Apr 18, 2022
A helper function to create a pointer to a new object in Go 1.18+

A helper function to create a pointer to a new object in Go 1.18+

Carl Johnson 52 Nov 9, 2022
Graceful - shutdown package when a service is turned off by software function

graceful Graceful shutdown package when a service is turned off by software func

Bo-Yi Wu 43 Dec 29, 2022
Calculate the efficient frontier

Calculate the efficient frontier

Wyman Lin 104 Nov 11, 2022
A Go (golang) library for parsing and verifying versions and version constraints.

go-version is a library for parsing versions and version constraints, and verifying versions against a set of constraints. go-version can sort a collection of versions properly, handles prerelease/beta versions, can increment versions, etc.

HashiCorp 1.3k Jan 9, 2023
🍕 Enjoy a slice! A utility library for dealing with slices and maps that focuses on type safety and performance.

?? github.com/elliotchance/pie Enjoy a slice! pie is a library of utility functions for common operations on slices and maps. Quick Start FAQ What are

Elliot Chance 1.2k Dec 30, 2022
A tool and library for using structural regular expressions.

Structural Regular Expressions sregx is a package and tool for using structural regular expressions as described by Rob Pike (link).

Zachary Yedidia 41 Dec 7, 2022
Go library for decoding generic map values into native Go structures and vice versa.

mapstructure mapstructure is a Go library for decoding generic map values to structures and vice versa, while providing helpful error handling. This l

Mitchell Hashimoto 6.4k Dec 28, 2022
Go library that provides fuzzy string matching optimized for filenames and code symbols in the style of Sublime Text, VSCode, IntelliJ IDEA et al.

Go library that provides fuzzy string matching optimized for filenames and code symbols in the style of Sublime Text, VSCode, IntelliJ IDEA et al. This library is external dependency-free. It only depends on the Go standard library.

Sahil Muthoo 1.2k Dec 27, 2022
Cogger is a standalone binary and a golang library that reads an internally tiled geotiff

Cogger is a standalone binary and a golang library that reads an internally tiled geotiff (optionally with overviews and masks) and rewrites it

Airbus DS GEO S.A. 84 Dec 12, 2022