Skip to content

template for golang library

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

bridgewwater/template-golang-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

260 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ci TravisBuildStatus

go mod version GoDoc goreportcard

GitHub license codecov GitHub latest SemVer tag) GitHub release)

cli tools to init project fast

$ v=1.7.0; curl -L --fail https://raw.githubusercontent.com/bridgewwater/template-golang-lib/v$v/temp-golang-lib -o temp-golang-lib
# let temp-golang-lib file folder under $PATH
$ chmod +x temp-golang-lib
# see how to use
$ temp-golang-lib -h

for what

  • this project used to github golang lib project

Contributing

Contributor Covenant GitHub contributors

We welcome community contributions to this project.

Please read Contributor Guide for more information on how to get started.

请阅读有关 贡献者指南 以获取更多如何入门的信息

depends

in go mod project

# warning use private git host must set
# global set for once
# add private git host like github.com to evn GOPRIVATE
$ go env -w GOPRIVATE='github.com'
# use ssh proxy
# set ssh-key to use ssh as http
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
# or use PRIVATE-TOKEN
# set PRIVATE-TOKEN as gitlab or gitea
$ git config --global http.extraheader "PRIVATE-TOKEN: {PRIVATE-TOKEN}"
# set this rep to download ssh as https use PRIVATE-TOKEN
$ git config --global url."ssh://github.com/".insteadOf "https://github.com/"

# before above global settings
# test version info
$ git ls-remote -q https://github.com/bridgewwater/template-golang-lib.git

# test depends see full version
$ go list -mod readonly -v -m -versions github.com/bridgewwater/template-golang-lib
# or use last version add go.mod by script
$ echo "go mod edit -require=$(go list -mod=readonly -m -versions github.com/bridgewwater/template-golang-lib | awk '{print $1 "@" $NF}')"
$ echo "go mod vendor"

Features

  • more perfect test case coverage
  • more perfect benchmark case

libs

lib version
https://github.com/stretchr/testify v1.8.4
https://github.com/sebdah/goldie v2.5.3

usage

  • use this template, replace list below
    • github.com/bridgewwater/template-golang-lib to your package name
    • bridgewwater to your owner name
    • template-golang-lib to your project name

dev

About

template for golang library

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors