mirror of
https://github.com/noandrea/geo2tz.git
synced 2025-12-22 10:47:07 +00:00
chore: fix fmt warnings
This commit is contained in:
11
cmd/root.go
11
cmd/root.go
@@ -14,6 +14,13 @@ var cfgFile string
|
|||||||
var debug bool
|
var debug bool
|
||||||
var settings web.ConfigSchema
|
var settings web.ConfigSchema
|
||||||
|
|
||||||
|
type RuntimeVersion struct {
|
||||||
|
Version string
|
||||||
|
Commit string
|
||||||
|
Date string
|
||||||
|
BuiltBy string
|
||||||
|
}
|
||||||
|
|
||||||
// rootCmd represents the base command when called without any subcommands.
|
// rootCmd represents the base command when called without any subcommands.
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "geo2tz",
|
Use: "geo2tz",
|
||||||
@@ -24,8 +31,8 @@ var rootCmd = &cobra.Command{
|
|||||||
|
|
||||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
||||||
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
||||||
func Execute(v string) error {
|
func Execute(v RuntimeVersion) error {
|
||||||
rootCmd.Version = v
|
rootCmd.Version = v.Version
|
||||||
|
|
||||||
if err := initConfig(); err != nil {
|
if err := initConfig(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
8
main.go
8
main.go
@@ -37,6 +37,14 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
version := cmd.RuntimeVersion{
|
||||||
|
Version: version,
|
||||||
|
Commit: commit,
|
||||||
|
Date: date,
|
||||||
|
BuiltBy: builtBy,
|
||||||
|
}
|
||||||
|
|
||||||
if err := cmd.Execute(version); err != nil {
|
if err := cmd.Execute(version); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user