File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ import (
1919 "gotest.tools/gotestsum/testjson"
2020)
2121
22+ var version = ""
23+
2224func Run (name string , args []string ) error {
2325 flags , opts := setupFlags (name )
2426 switch err := flags .Parse (args ); {
@@ -33,11 +35,14 @@ func Run(name string, args []string) error {
3335
3436 switch {
3537 case opts .version :
36- info , ok := debug .ReadBuildInfo ()
37- if ! ok {
38- return fmt .Errorf ("failed to read version info" )
38+ if len (version ) == 0 {
39+ info , ok := debug .ReadBuildInfo ()
40+ if ! ok {
41+ return fmt .Errorf ("failed to read version info" )
42+ }
43+ version = info .Main .Version
3944 }
40- fmt .Fprintf (os .Stdout , "gotestsum version %s\n " , info . Main . Version )
45+ fmt .Fprintf (os .Stdout , "gotestsum version %s\n " , version )
4146 return nil
4247 case opts .watch :
4348 return runWatcher (opts )
You can’t perform that action at this time.
0 commit comments