mirror of
https://github.com/onyx-and-iris/vbantxt.git
synced 2026-03-07 18:49:19 +00:00
Compare commits
No commits in common. "main" and "v0.6.2" have entirely different histories.
@ -20,19 +20,6 @@ import (
|
|||||||
|
|
||||||
var version string // Version will be set at build time
|
var version string // Version will be set at build time
|
||||||
|
|
||||||
// versionFromBuild retrieves the version information from the build metadata.
|
|
||||||
func versionFromBuild() string {
|
|
||||||
if version != "" {
|
|
||||||
return version
|
|
||||||
}
|
|
||||||
|
|
||||||
info, ok := debug.ReadBuildInfo()
|
|
||||||
if !ok {
|
|
||||||
return "(unable to read version)"
|
|
||||||
}
|
|
||||||
return strings.Split(info.Main.Version, "-")[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
// Flags holds the command-line flags for the VBANTXT client.
|
// Flags holds the command-line flags for the VBANTXT client.
|
||||||
type Flags struct {
|
type Flags struct {
|
||||||
Host string
|
Host string
|
||||||
@ -162,6 +149,19 @@ func run() (func(), error) {
|
|||||||
return closer, nil
|
return closer, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// versionFromBuild retrieves the version information from the build metadata.
|
||||||
|
func versionFromBuild() string {
|
||||||
|
if version != "" {
|
||||||
|
return version
|
||||||
|
}
|
||||||
|
|
||||||
|
info, ok := debug.ReadBuildInfo()
|
||||||
|
if !ok {
|
||||||
|
return "(unable to read version)"
|
||||||
|
}
|
||||||
|
return strings.Split(info.Main.Version, "-")[0]
|
||||||
|
}
|
||||||
|
|
||||||
// createClient creates a new vban client with the provided options.
|
// createClient creates a new vban client with the provided options.
|
||||||
func createClient(flags *Flags) (*vbantxt.VbanTxt, func(), error) {
|
func createClient(flags *Flags) (*vbantxt.VbanTxt, func(), error) {
|
||||||
client, err := vbantxt.New(
|
client, err := vbantxt.New(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user