You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to know the version of the binary by using a command like capture --version. Without knowing the exact version of capture, we cannot be 100% certain about its behavior.
It's very important for troubleshooting.
How to implement?
package main
import (
"flag""fmt""os"
)
varversion="develop"// We can modify the version variable on the compile time using go build flagsfuncmain() {
showVersion:=flag.Bool("version", false, "Display the version of the capture")
flag.Parse()
// Check if the version flag is providedif*showVersion {
fmt.Printf("capture version: %s\n", version)
os.Exit(0)
}
// rest of it
}
The text was updated successfully, but these errors were encountered:
* feat(main): Add version flag to display application version #41
Signed-off-by: Mert Şişmanoğlu <mert190737fb@gmail.com>
* feat(goreleaser): Add versioning support and static build flags
- s
- w
- extldflags static
- X main.Version = APP_VERSION
Signed-off-by: Mert Şişmanoğlu <mert190737fb@gmail.com>
---------
Signed-off-by: Mert Şişmanoğlu <mert190737fb@gmail.com>
Enhancement
We need to know the version of the binary by using a command like
capture --version
. Without knowing the exact version of capture, we cannot be 100% certain about its behavior.It's very important for troubleshooting.
How to implement?
The text was updated successfully, but these errors were encountered: