Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golang.org/dl/gotip: needs to add its go binary to PATH #35507

Closed
dmitshur opened this issue Nov 11, 2019 · 1 comment
Closed

golang.org/dl/gotip: needs to add its go binary to PATH #35507

dmitshur opened this issue Nov 11, 2019 · 1 comment
Assignees
Milestone

Comments

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Nov 11, 2019

The fix for #28103 was applied to the golang.org/dl/internal/version package, which fixed the problem for all golang.org/dl/go... packages other than golang.org/dl/gotip.

I tested with a small program:

main.go source
package main

import (
	"fmt"
	"log"
	"os/exec"
)

func main() {
	goBin, err := exec.LookPath("go")
	if err != nil {
		log.Fatalln(err)
	}
	fmt.Println(goBin)
	out, err := exec.Command(goBin, "version").Output()
	if err != nil {
		log.Fatalln(err)
	}
	fmt.Printf("%s version: %s", goBin, out)
}
$ go run ./main.go
/usr/local/go/bin/go
/usr/local/go/bin/go version: go version go1.13.4 darwin/amd64
$ go1.12.9 run ./main.go
/Users/dmitshur/sdk/go1.12.9/bin/go
/Users/dmitshur/sdk/go1.12.9/bin/go version: go version go1.12.9 darwin/amd64
$ gotip run ./main.go
/usr/local/go/bin/go
/usr/local/go/bin/go version: go version go1.13.4 darwin/amd64

gotip run ./main.go should be printing:

/Users/dmitshur/sdk/gotip/bin/go
/Users/dmitshur/sdk/gotip/bin/go version: go version devel +ad7ce391 Mon Nov 11 18:00:18 2019 +0000 darwin/amd64
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 11, 2019

Change https://golang.org/cl/206537 mentions this issue: gotip: add $GOROOT/bin to $PATH before starting go binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.