mirror of
https://github.com/therootcompany/go-gitver.git
synced 2024-11-16 17:08:59 +00:00
Compare commits
No commits in common. "master" and "v2.0.2" have entirely different histories.
@ -1,6 +1,6 @@
|
||||
# [Go GitVer](https://git.rootprojects.org/root/go-gitver)
|
||||
|
||||
Use **git tags** to add (GoReleaser-compatible) [**semver**](https://semver.org/)
|
||||
Use **git tags** to add (GoRelesear-compatible) [**semver**](https://semver.org/)
|
||||
to your go package in under 150
|
||||
[lines of code](https://git.rootprojects.org/root/go-gitver/src/branch/master/gitver/gitver.go).
|
||||
|
||||
@ -28,11 +28,6 @@ See <https://pkg.go.dev/git.rootprojects.org/root/go-gitver/v2>.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
commit = "0000000"
|
||||
version = "0.0.0-pre0+0000000"
|
||||
@ -40,7 +35,7 @@ var (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if (len(os.Args) > 1 && "version" == strings.TrimLeft(os.Args[1], "-")) {
|
||||
if (len(os.Args) > 1 && "version" === os.Args[1]) {
|
||||
fmt.Printf("Foobar v%s (%s) %s\n", version, commit[:7], date)
|
||||
}
|
||||
// ...
|
||||
|
@ -2,4 +2,6 @@ module example.com/hello
|
||||
|
||||
go 1.12
|
||||
|
||||
require git.rootprojects.org/root/go-gitver/v2 v2.0.2
|
||||
require (
|
||||
git.rootprojects.org/root/go-gitver/v2 v2.0.1
|
||||
)
|
||||
|
@ -2,4 +2,6 @@ module example.com/hello
|
||||
|
||||
go 1.12
|
||||
|
||||
require git.rootprojects.org/root/go-gitver/v2 v2.0.2
|
||||
require (
|
||||
git.rootprojects.org/root/go-gitver/v2 v2.0.1
|
||||
)
|
||||
|
@ -2,4 +2,6 @@ module example.com/hello
|
||||
|
||||
go 1.12
|
||||
|
||||
require git.rootprojects.org/root/go-gitver/v2 v2.0.2
|
||||
require (
|
||||
git.rootprojects.org/root/go-gitver/v2 v2.0.1
|
||||
)
|
||||
|
@ -2,4 +2,6 @@ module example.com/hello
|
||||
|
||||
go 1.12
|
||||
|
||||
require git.rootprojects.org/root/go-gitver/v2 v2.0.2
|
||||
require (
|
||||
git.rootprojects.org/root/go-gitver/v2 v2.0.1
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user