Skip to content

Commit 3cba725

Browse files
committed
Fix newline and unhandled error
1 parent e6bb80a commit 3cba725

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

klog/app/cli/version.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func (opt *Version) Run(ctx app.Context) app.Error {
5353

5454
origin, v := fetchVersionInfo(versionCheckers)
5555
close(stopTicker)
56+
ctx.Print("\n")
5657
if v == nil {
5758
return app.NewError(
5859
"Failed to retrieve version information.",
@@ -61,7 +62,6 @@ func (opt *Version) Run(ctx app.Context) app.Error {
6162
)
6263
}
6364

64-
ctx.Print("\n")
6565
ctx.Debug(func() {
6666
ctx.Print("Fetched from: " + origin.url + "\n")
6767
})
@@ -107,7 +107,10 @@ func progressTicker(onTick func(), stop chan bool) {
107107
// one after the other. It returns the first response that succeeds.
108108
func fetchVersionInfo(origins []versionChecker) (*versionChecker, versionInfo) {
109109
for _, origin := range origins {
110-
req, _ := http.NewRequest(http.MethodGet, origin.url, nil)
110+
req, err := http.NewRequest(http.MethodGet, origin.url, nil)
111+
if err != nil {
112+
continue
113+
}
111114
res, err := (&http.Client{
112115
Timeout: time.Second * 5,
113116
}).Do(req)

0 commit comments

Comments
 (0)