gotip: fix panic for no arguments

Fixes: golang/go#39099
Change-Id: If89740a3913f489b058af177b340dde82c0738e9
Reviewed-on: https://go-review.googlesource.com/c/dl/+/234158
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/gotip/main.go b/gotip/main.go
index caafe34..d1c69cc 100644
--- a/gotip/main.go
+++ b/gotip/main.go
@@ -37,7 +37,7 @@
 		log.Fatalf("gotip: %v", err)
 	}
 
-	if os.Args[1] == "download" {
+	if len(os.Args) > 1 && os.Args[1] == "download" {
 		switch len(os.Args) {
 		case 2:
 			if err := installTip(root, ""); err != nil {