github.com/youyuanwu/go-swagger@v0.19.0/cmd/swagger/commands/version.go (about) 1 package commands 2 3 import "fmt" 4 5 var ( 6 // Version for the swagger command 7 Version string 8 // Commit for the swagger command 9 Commit string 10 ) 11 12 // PrintVersion the command 13 type PrintVersion struct { 14 } 15 16 // Execute this command 17 func (p *PrintVersion) Execute(args []string) error { 18 if Version == "" { 19 fmt.Println("dev") 20 return nil 21 } 22 fmt.Println("version:", Version) 23 fmt.Println("commit:", Commit) 24 25 return nil 26 }