This is an open source project for commonly used functions for the Go programming language.

Related tags

Utilities go
Overview

Common Functions

Build Status Go Walker

This is an open source project for commonly used functions for the Go programming language.

This package need >= go 1.3

Code Convention: based on Go Code Convention.

Contribute

Your contribute is welcome, but you have to check following steps after you added some functions and commit them:

  1. Make sure you wrote user-friendly comments for all functions .
  2. Make sure you wrote test cases with any possible condition for all functions in file *_test.go.
  3. Make sure you wrote benchmarks for all functions in file *_test.go.
  4. Make sure you wrote useful examples for all functions in file example_test.go.
  5. Make sure you ran go test and got PASS .
Issues
  • go mod 管理

    go mod 管理

    您好,我才用go mod download 对这个包进行下载的时候 显示为 go.mod unexpect module path"github.com/unknown/com",请问是release 的时候没有标记具体的版本号的原因吗,使用了 github.com/unknown/com latest 依旧有错误,如果release 的时候指定了版本 github.com/unknown/com V1.0.0 是不是不会出错了

    opened by liu-song 5
  • 你好, 我在试用GO MODULE加载时出现如下错误

    你好, 我在试用GO MODULE加载时出现如下错误

    go: finding github.com/Unknwon/com latest go: github.com/Unknwon/[email protected]: parsing go.mod: unexpected module path "github.com/unknwon/com" go: error loading module requirements

    opened by Sixteen-16 3
  • Broken downstream builds

    Broken downstream builds

    Just an FYI, this commit https://github.com/Unknwon/com/commit/0db4a625e949e956314d7d1adea9bf82384cc10c changed the AESDecrypt function interface, which broke your routing package macaron, which in turn broke the entire build of the http routing bechmark project that you submitted that router to.

    Go relies on having a stable HEAD for all github sources. If you're going to commit your projects as modules to other projects, be a good member of the community and commit to stable interfaces. Especially since you declared a v1.0 release on this project which should indicate your interfaces are now stable.

    opened by AndrewBurian 3
  • please tag and version this project

    please tag and version this project

    Hello,

    Can you please tag and version this project?

    I am the Debian Maintainer for Unknwon/com and versioning would help Debian keep up with development.

    opened by aviau 2
  • Jobs failing on Travis-CI for Intel

    Jobs failing on Travis-CI for Intel

    Hi All, I am running jobs on travis-ci and found that jobs are failing for go versions. Below are the logs

    $ git clone --depth=50 --branch=master https://github.com/kishorkunal-raj/com.git kishorkunal-raj/com
    $ travis_export_go 1.3.x github.com/kishorkunal-raj/com
    0.01s2.43s$ travis_setup_go
    go version go1.3.3 linux/amd64
    $ export GOPATH="/home/travis/gopath"
    $ export PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.3.3.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/[email protected]/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.3/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin"
    $ export GO111MODULE="auto"
    $ gimme version
    v1.5.4
    $ go version
    go version go1.3.3 linux/amd64
    go.env
    $ go env
    install
    2.87s$ go get -v -t
    0.40s$ travis_script_go -v
    # github.com/smartystreets/assertions
    ../../smartystreets/assertions/panic.go:81: undefined: errors.Is
    ../../smartystreets/assertions/panic.go:116: undefined: errors.Is
    ../../smartystreets/assertions/type.go:146: undefined: errors.Is
    FAIL	github.com/kishorkunal-raj/com [build failed]
    The command "go test -v ./..." exited with 2.
    
    Done. Your build exited with 1.
    

    Please help me out to fix it.

    opened by kishorkunal-raj 1
  • Fix function comments based on best practices from Effective Go

    Fix function comments based on best practices from Effective Go

    Hi, we updated some exported function comments based on best practices from Effective Go. It’s admittedly a relatively minor fix up. Does this help you?

    opened by CodeLingoTeam 1
  • Enable go modules

    Enable go modules

    Go modules are becoming a de-facto standard in the Go community and adding go.mod files with metadata helps projects which may consume this repository as a dependency in deciding how to pin transitive dependencies and how to resolve conflicts.

    This is a result of the following commands:

    go mod init
    go get ./...
    go mod tidy
    

    in a clean Go 1.11.5 environment.

    opened by radeksimko 1
  • Support for following symbolic links in GetAllSubDirs and StatDir

    Support for following symbolic links in GetAllSubDirs and StatDir

    Fixes #17

    Introduces two new functions, LgetAllSubDirs and LstatDir which is copies of GetAllSubDirs and StatDir, but with the difference that they will follow symbolic links.

    opened by marefr 1
  • gofmt

    gofmt

    Just ran

    gofmt -w .
    

    on the project root. That's all.

    https://blog.golang.org/go-fmt-your-code


    I made this PR with a project going on over at https://github.com/rotblauer/gofmt-att, and it's definitely a work in progress. So if I got something wrong, or this is annoying at all, please file an issue over there and we'll sort it out.

    opened by whilei 1
  • Switch from using AES CFB to AES GCM

    Switch from using AES CFB to AES GCM

    I'd like to propose that this library use AES in GCM mode instead of CFB mode https://github.com/Unknwon/com/blob/28b053d5a2923b87ce8c5a08f3af779894a72758/string.go#L45 https://github.com/Unknwon/com/blob/28b053d5a2923b87ce8c5a08f3af779894a72758/string.go#L61

    GCM is fast (can be parallelized) but is also authenticated which is the biggest benefit over CFB and most other modes.

    opened by aaronjwood 1
  • Go 1.15: conversion from untyped int to string yields a string of one rune

    Go 1.15: conversion from untyped int to string yields a string of one rune

    Go 1.15 rc 1 on Fedora Rawhide

    Testing    in: /builddir/build/BUILD/com-1.0.1/_build/src
             PATH: /builddir/build/BUILD/com-1.0.1/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
           GOPATH: /builddir/build/BUILD/com-1.0.1/_build:/usr/share/gocode
      GO111MODULE: off
          command: go test -buildmode pie -compiler gc -ldflags "-X github.com/unknwon/com/version=1.0.1 -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '"
          testing: github.com/unknwon/com
    github.com/unknwon/com
    # github.com/unknwon/com
    ./convert.go:26:22: conversion from untyped int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
    ./convert.go:159:8: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
    ./convert.go:161:8: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
    FAIL	github.com/unknwon/com [build failed]
    

    See https://github.com/golang/go/issues/32479

    opened by eclipseo 0
Owner
ᴜɴᴋɴᴡᴏɴ
ʟɪғᴇ ɪs ᴍᴀɢɪᴄ. ᴄᴏᴅɪɴɢ ɪs ᴀʀᴛ.
ᴜɴᴋɴᴡᴏɴ
a decision & trigger framework backed by Google's Common Expression Language used in graphikDB

a decision & trigger framework backed by Google's Common Expression Language used in graphikDB

null 61 Apr 24, 2022
Easy to use open source hardware to drive WS2811 LEDs with high-quality color

STOP DOING FADECANDY LEDs were not supposed to be given data pins YEARS of "temporal dithering" but no real-world use found for having more than three

Micah Elizabeth Scott 1.2k Jun 15, 2022
Rest Api Generator for Golang Programming Language

Rest Api Generator for Golang Programming Language

Eko Kurniadi 3 Nov 29, 2021
A super simple Lodash like utility library with essential functions that empowers the development in Go

A simple Utility library for Go Go does not provide many essential built in functions when it comes to the data structure such as slice and map. This

Rahul Baruri 127 Jun 22, 2022
Use Golang to implement PHP's common built-in functions.

PHP2Go Use Golang to implement PHP's common built-in functions. About 140+ functions have been implemented. Install go get github.com/syyongx/php2go R

syyong.x 1.4k Jun 28, 2022
randstr is a module that contains functions for generating random strings.

randstr is a module that contains functions for generating random strings. The functions in this module uses the crypto/rand package. Installa

Henrik Christensen 3 Nov 13, 2021
Go linter that warns about number of arguments in functions.

argslen linter Argslen is a linter that checks for long list of argument in functions. The default limit is 5 (maxArguments) and skip the test files (

Federico Guerinoni 5 Sep 28, 2021
The one-stop shop for most common Go functions

Pandati The one stop shop for most common Go functions Table of contents Pandati The one stop shop for most common Go functions Table of contents Purp

Lukasz Raczylo 2 Mar 21, 2022
Utility functions for work with the Kubernetes Go-Client

go-k8s-utils This repository contains utils for the work with Kubernetes, in specific with the go-client library. Testing This package contains utils

Christoph Stäbler 1 Mar 11, 2022
Extended library functions using generics in Go.

Just few extended standard library functions for Golang using generics.

null 1 Dec 16, 2021
Simple library to handle ANSI functions and parsing of color formatting strings

Emerald A basic color library for use in my Go projects, built on top of mgutz/ansi. Package ansi is a small, fast library to create ANSI colored stri

Josh Willox 0 Nov 15, 2021
Tiny Go tool for running multiple functions concurrently and collecting their results into an error slice.

Overview Short for "ConCurrent". Tiny Go tool for running multiple functions concurrently and collecting their results into an error slice. Dependency

Nelo Mitranim 0 Nov 22, 2021
Calling functions by name and getting outputs by using reflect package.

Invoker A library to call (invoke) functions by taking names and sample inputs of those functions as parameters. And returns the types and values of o

null 3 Dec 20, 2021
Some utility functions for generic types in Go.

GOUF - Utility Functions for generic types Go team released Go 1.18 beta recently with support for Generics(a.k.a type parameters). This package provi

Akshay Bharambe 18 Apr 13, 2022
Convert dates from or to 31 calendars in Go. Implements the functions discussed in Reingold/Dershowitz 2018.

libcalcal - Calendrical calculations in Go About libcalcal implements in Go the functions described and presented in: Reingold, Edward M., and Nachum

null 1 Dec 30, 2021
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 81 Jun 20, 2022
Slice - provides generic Map, Reduce and Filter functions for Go.

slice slice is a simple Go package to provide generic versions of Map, Reduce and Filter on slices. I mainly wrote it as an exercise to get more famil

Andreas Krennmair 18 Jun 20, 2022
Protoc-gen-fieldmask - Generate FieldMask utility functions for protobuf

protoc-gen-fieldmask Generate FieldMask utility functions for protobuf Generated

yeqown 25 May 28, 2022
This is a small utility that finds unused exported Go symbols (functions, methods ...) in Go

This is a small utility that finds unused exported Go symbols (functions, methods ...) in Go. For all other similar use cases

Bjørn Erik Pedersen 14 Jun 21, 2022