1
0
mirror of https://github.com/therootcompany/go-gitver.git synced 2024-11-16 17:08:59 +00:00

Compare commits

..

3 Commits

Author SHA1 Message Date
1638772379
docs: fix typo 2023-01-18 14:10:35 -07:00
752451d77b
fix typo 2021-04-15 02:15:55 -06:00
3409d5f2e4 update examples 2020-10-12 14:46:35 -06:00
6 changed files with 11 additions and 16 deletions

View File

@ -1,6 +1,6 @@
# [Go GitVer](https://git.rootprojects.org/root/go-gitver) # [Go GitVer](https://git.rootprojects.org/root/go-gitver)
Use **git tags** to add (GoRelesear-compatible) [**semver**](https://semver.org/) Use **git tags** to add (GoReleaser-compatible) [**semver**](https://semver.org/)
to your go package in under 150 to your go package in under 150
[lines of code](https://git.rootprojects.org/root/go-gitver/src/branch/master/gitver/gitver.go). [lines of code](https://git.rootprojects.org/root/go-gitver/src/branch/master/gitver/gitver.go).
@ -28,6 +28,11 @@ See <https://pkg.go.dev/git.rootprojects.org/root/go-gitver/v2>.
package main package main
import (
"fmt"
"strings"
)
var ( var (
commit = "0000000" commit = "0000000"
version = "0.0.0-pre0+0000000" version = "0.0.0-pre0+0000000"
@ -35,7 +40,7 @@ var (
) )
func main() { func main() {
if (len(os.Args) > 1 && "version" === os.Args[1]) { if (len(os.Args) > 1 && "version" == strings.TrimLeft(os.Args[1], "-")) {
fmt.Printf("Foobar v%s (%s) %s\n", version, commit[:7], date) fmt.Printf("Foobar v%s (%s) %s\n", version, commit[:7], date)
} }
// ... // ...

View File

@ -2,6 +2,4 @@ module example.com/hello
go 1.12 go 1.12
require ( require git.rootprojects.org/root/go-gitver/v2 v2.0.2
git.rootprojects.org/root/go-gitver/v2 v2.0.1
)

View File

@ -2,6 +2,4 @@ module example.com/hello
go 1.12 go 1.12
require ( require git.rootprojects.org/root/go-gitver/v2 v2.0.2
git.rootprojects.org/root/go-gitver/v2 v2.0.1
)

View File

@ -2,6 +2,4 @@ module example.com/hello
go 1.12 go 1.12
require ( require git.rootprojects.org/root/go-gitver/v2 v2.0.2
git.rootprojects.org/root/go-gitver/v2 v2.0.1
)

View File

@ -2,6 +2,4 @@ module example.com/hello
go 1.12 go 1.12
require ( require git.rootprojects.org/root/go-gitver/v2 v2.0.2
git.rootprojects.org/root/go-gitver/v2 v2.0.1
)

2
go.sum
View File

@ -1,2 +0,0 @@
git.rootprojects.org/root/go-gitver v1.1.3 h1:/qR9z53vY+IFhWRxLkF9cjaiWh8xRJIm6gyuW+MG81A=
git.rootprojects.org/root/go-gitver v1.1.3/go.mod h1:Rj1v3TBhvdaSphFEqMynUYwAz/4f+wY/+syBTvRrmlI=