Skip to content

Commit 67009da

Browse files
committed
Include version number in build
1 parent b1352ed commit 67009da

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.goreleaser.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ builds:
2828
- goos: darwin
2929
goarch: 386
3030
binary: '{{ .ProjectName }}'
31-
ldflags: -s -w
31+
ldflags: -s -w -X 'main.version={{ .Version }}'
3232
flags:
3333
- -trimpath
3434

@@ -67,6 +67,8 @@ brews:
6767
homepage: https://github.com/colinodell/go-check-ssl
6868
description: Simple command line utility to check the status of an SSL certificate
6969
license: MIT
70+
test: |
71+
system "#{bin}/check-ssl --version"
7072
install: |-
7173
bin.install "{{ .ProjectName }}"
7274

main.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ import (
2020
var (
2121
server = kingpin.Arg("host", "Hostname, IP, or URL of the server to check.").String()
2222
sni = kingpin.Flag("sni", "SNI server to use for the certificate (optional).").Short('s').String()
23+
version = "dev"
2324
)
2425

2526
func main() {
2627
log.SetLogger(new(logger))
2728

29+
kingpin.Version(version)
2830
kingpin.Parse()
2931
if server == nil || *server == "" {
3032
kingpin.Usage()

0 commit comments

Comments
 (0)