Skip to content

Commit

Permalink
Fix issue with missing download
Browse files Browse the repository at this point in the history
  • Loading branch information
dz0ny committed Aug 22, 2016
1 parent f6ce9e6 commit fe02991
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GOVERSION := 1.7.0
VERSION := 0.7.0
GOVERSION := 1.7
VERSION := 0.7.1

all: setup build lint

Expand Down
2 changes: 1 addition & 1 deletion src/gobu/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
var goPath = ""
var execCmd = ""
var envPath = ".gobu"
var globalVersion = "1.7.0"
var globalVersion = "1.7"
var onlinePath = "https://storage.googleapis.com/golang/go%s.%s-%s.tar.gz"

func userHomeDir() string {
Expand Down
8 changes: 7 additions & 1 deletion src/gobu/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ func download(version string) {
log.Printf("Target path: %s", target)
out, _ := os.Create(local)
defer out.Close()
resp, _ := http.Get(onlinePath)
resp, err := http.Get(onlinePath)
if resp.StatusCode > 400 {
log.Fatalf("go toolchain download: %s is not there", onlinePath)
}
if err != nil {
log.Fatalf("go toolchain download: %v", err)
}
defer resp.Body.Close()
io.Copy(out, resp.Body)
untar(local, target)
Expand Down

0 comments on commit fe02991

Please sign in to comment.