File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -269,8 +269,6 @@ func getDepMode() DependencyInstallerMode {
269269
270270// Tries to open `go.mod` and read a go directive, returning the version and whether it was found.
271271func tryReadGoDirective (depMode DependencyInstallerMode ) (string , bool ) {
272- version := ""
273- found := false
274272 if depMode == GoGetWithModules {
275273 versionRe := regexp .MustCompile (`(?m)^go[ \t\r]+([0-9]+\.[0-9]+)$` )
276274 goMod , err := os .ReadFile ("go.mod" )
@@ -279,14 +277,13 @@ func tryReadGoDirective(depMode DependencyInstallerMode) (string, bool) {
279277 } else {
280278 matches := versionRe .FindSubmatch (goMod )
281279 if matches != nil {
282- found = true
283280 if len (matches ) > 1 {
284- version = string (matches [1 ])
281+ return string (matches [1 ]), true
285282 }
286283 }
287284 }
288285 }
289- return version , found
286+ return "" , false
290287}
291288
292289// Returns the appropriate ModMode for the current project
You can’t perform that action at this time.
0 commit comments