cmd/go: address vet complaints in vgo code

Change-Id: Ied3878c0681bef0add151342b0176e9a6a402ffb
Reviewed-on: https://go-review.googlesource.com/118319
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
diff --git a/vendor/cmd/go/internal/modfetch/query.go b/vendor/cmd/go/internal/modfetch/query.go
index 525b594..5e9d86c 100644
--- a/vendor/cmd/go/internal/modfetch/query.go
+++ b/vendor/cmd/go/internal/modfetch/query.go
@@ -37,7 +37,7 @@
 		// TODO: This turns query for "v2" into Stat "v2.0.0",
 		// but probably it should allow checking for a branch named "v2".
 		vers = semver.Canonical(vers)
-		if allowed != nil && !allowed(module.Version{path, vers}) {
+		if allowed != nil && !allowed(module.Version{Path: path, Version: vers}) {
 			return nil, fmt.Errorf("%s@%s excluded", path, vers)
 		}
 		return repo.Stat(vers)
@@ -59,19 +59,19 @@
 		}
 		if vers == "latest" {
 			for i := len(versions) - 1; i >= 0; i-- {
-				if allowed == nil || allowed(module.Version{path, versions[i]}) {
+				if allowed == nil || allowed(module.Version{Path: path, Version: versions[i]}) {
 					return repo.Stat(versions[i])
 				}
 			}
 		} else if op == "<" {
 			for i := len(versions) - 1; i >= 0; i-- {
-				if semver.Compare(versions[i], vers) < 0 && (allowed == nil || allowed(module.Version{path, versions[i]})) {
+				if semver.Compare(versions[i], vers) < 0 && (allowed == nil || allowed(module.Version{Path: path, Version: versions[i]})) {
 					return repo.Stat(versions[i])
 				}
 			}
 		} else {
 			for i := 0; i < len(versions); i++ {
-				if semver.Compare(versions[i], vers) > 0 && (allowed == nil || allowed(module.Version{path, versions[i]})) {
+				if semver.Compare(versions[i], vers) > 0 && (allowed == nil || allowed(module.Version{Path: path, Version: versions[i]})) {
 					return repo.Stat(versions[i])
 				}
 			}
diff --git a/vendor/cmd/go/internal/mvs/mvs.go b/vendor/cmd/go/internal/mvs/mvs.go
index c30ac46..47670ff 100644
--- a/vendor/cmd/go/internal/mvs/mvs.go
+++ b/vendor/cmd/go/internal/mvs/mvs.go
@@ -81,7 +81,7 @@
 			}
 			if _, ok := vers[r.Path]; !ok {
 				vers[r.Path] = v
-				list = append(list, module.Version{r.Path, v})
+				list = append(list, module.Version{Path: r.Path, Version: v})
 			}
 		}
 	}
@@ -183,7 +183,7 @@
 			}
 			if !have[r.Path] {
 				have[r.Path] = true
-				list = append(list, module.Version{r.Path, latest.Version})
+				list = append(list, module.Version{Path: r.Path, Version: latest.Version})
 			}
 		}
 	}
diff --git a/vendor/cmd/go/internal/mvs/mvs_test.go b/vendor/cmd/go/internal/mvs/mvs_test.go
index 717964c..0fd55e4 100644
--- a/vendor/cmd/go/internal/mvs/mvs_test.go
+++ b/vendor/cmd/go/internal/mvs/mvs_test.go
@@ -217,7 +217,7 @@
 		}
 	}
 	m := func(s string) module.Version {
-		return module.Version{s[:1], s[1:]}
+		return module.Version{Path: s[:1], Version: s[1:]}
 	}
 	ms := func(list []string) []module.Version {
 		var mlist []module.Version
@@ -350,7 +350,7 @@
 		}
 	}
 	if m.Path == "" {
-		return module.Version{}, &MissingModuleError{module.Version{path, ""}}
+		return module.Version{}, &MissingModuleError{module.Version{Path: path, Version: ""}}
 	}
 	return m, nil
 }
@@ -363,7 +363,7 @@
 		}
 	}
 	if p.Path == "" {
-		return module.Version{m.Path, "none"}, nil
+		return module.Version{Path: m.Path, Version: "none"}, nil
 	}
 	return p, nil
 }
diff --git a/vendor/cmd/go/internal/vgo/get.go b/vendor/cmd/go/internal/vgo/get.go
index 89bcd7d..9fd8497 100644
--- a/vendor/cmd/go/internal/vgo/get.go
+++ b/vendor/cmd/go/internal/vgo/get.go
@@ -84,7 +84,7 @@
 			vers = "latest"
 		}
 		if vers == "none" {
-			downgrade = append(downgrade, module.Version{path, ""})
+			downgrade = append(downgrade, module.Version{Path: path, Version: ""})
 		} else {
 			info, err := modfetch.Query(path, vers, allowed)
 			if err != nil {
diff --git a/vendor/cmd/go/internal/vgo/load.go b/vendor/cmd/go/internal/vgo/load.go
index 1b14e4b..7b85cd0 100644
--- a/vendor/cmd/go/internal/vgo/load.go
+++ b/vendor/cmd/go/internal/vgo/load.go
@@ -331,7 +331,7 @@
 	}
 	found[root] = true
 	fmt.Fprintf(os.Stderr, "vgo: adding %s %s\n", root, info.Version)
-	buildList = append(buildList, module.Version{root, info.Version})
+	buildList = append(buildList, module.Version{Path: root, Version: info.Version})
 	modFile.AddRequire(root, info.Version)
 }
 
@@ -422,7 +422,7 @@
 	if !semver.IsValid(mod.Version) {
 		// Disallow the broader queries supported by fetch.Lookup.
 		panic(fmt.Errorf("invalid semantic version %q for %s", mod.Version, mod.Path))
-		return nil, fmt.Errorf("invalid semantic version %q", mod.Version)
+		// TODO: return nil, fmt.Errorf("invalid semantic version %q", mod.Version)
 	}
 
 	gomod := filepath.Join(srcV, "cache", mod.Path, "@v", mod.Version+".mod")