Skip to content

Commit

Permalink
handle the case where version is not available
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
  • Loading branch information
ahmetb committed Aug 4, 2016
1 parent affae94 commit e32f923
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func process(dir string, args []string) error {
return fmt.Errorf("cannot add ldflags: %v", err)
}
if err := execGoTool(args); err != nil {
return fmt.Errorf("go tool failed: %v", err)
return fmt.Errorf("go tool: %v", err)
}
return nil
}
Expand Down
3 changes: 3 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ var (
)

func versionString() string {
if Version == "" {
return "N/A"
}
return fmt.Sprintf("%s@%s-%s", Version, GitCommit, GitState)
}

0 comments on commit e32f923

Please sign in to comment.