$ 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- this project used to github golang lib project
We welcome community contributions to this project.
Please read Contributor Guide for more information on how to get started.
请阅读有关 贡献者指南 以获取更多如何入门的信息
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"- more perfect test case coverage
- more perfect benchmark case
| lib | version |
|---|---|
| https://github.com/stretchr/testify | v1.8.4 |
| https://github.com/sebdah/goldie | v2.5.3 |
- more libs see go.mod
- use this template, replace list below
github.com/bridgewwater/template-golang-libto your package namebridgewwaterto your owner nametemplate-golang-libto your project name
- see dev.md
