Skip to content

Commit 1bd551f

Browse files
committed
builder: fix buildInfo.String
1 parent 04560ba commit 1bd551f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

builder/builder.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ var runtimeVersion = runtime.Version
8888

8989
// String returns a formatted string containing all build information.
9090
func (info buildInfo) String() string {
91-
return fmt.Sprintf("%s %s(%s: %s) built at %s by %s",
92-
info.Name, info.Version, info.Branch, info.Commit, info.DateTime, runtimeVersion())
91+
br := info.Branch
92+
if br != "" {
93+
br += ": "
94+
}
95+
return fmt.Sprintf("%s %s(%s%s) built at %s by %s",
96+
info.Name, info.Version, br, info.Commit, info.DateTime, runtimeVersion())
9397
}
9498

9599
// Info returns a struct containing the build information.

0 commit comments

Comments
 (0)