internal/version: simplify versionArchiveURL

versionArchiveURL always return nil error. It's unexported, so it's
easy to simplify it. If it needs to return an error in the future,
it can be changed accordingly at that time.

Also move goURL declaration just before use, rather than earlier.

Change-Id: I7f16e42b35852cb7bfb5b854e8be7a468e7efdde
GitHub-Last-Rev: a609f1c6c6a5d84fe392f9e132dd46bea4b35b60
GitHub-Pull-Request: golang/dl#2
Reviewed-on: https://go-review.googlesource.com/134435
Reviewed-by: Andrew Bonventre <andybons@golang.org>
diff --git a/internal/version/version.go b/internal/version/version.go
index 95874fa..4d0bf3f 100644
--- a/internal/version/version.go
+++ b/internal/version/version.go
@@ -73,13 +73,10 @@
 		return nil
 	}
 
-	goURL, err := versionArchiveURL(version)
-	if err != nil {
-		return err
-	}
 	if err := os.MkdirAll(targetDir, 0755); err != nil {
 		return err
 	}
+	goURL := versionArchiveURL(version)
 	res, err := http.Head(goURL)
 	if err != nil {
 		return err
@@ -372,7 +369,7 @@
 }
 
 // versionArchiveURL returns the zip or tar.gz URL of the given Go version.
-func versionArchiveURL(version string) (string, error) {
+func versionArchiveURL(version string) string {
 	goos := getOS()
 
 	// TODO: Maybe we should parse
@@ -387,7 +384,7 @@
 	if goos == "linux" && runtime.GOARCH == "arm" {
 		arch = "armv6l"
 	}
-	return "https://storage.googleapis.com/golang/" + version + "." + goos + "-" + arch + ext, nil
+	return "https://storage.googleapis.com/golang/" + version + "." + goos + "-" + arch + ext
 }
 
 const caseInsensitiveEnv = runtime.GOOS == "windows"