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

cmd/go: go fmt should invoke gofmt from the current sdk installation #10755

Closed
zolotov opened this issue May 8, 2015 · 3 comments
Closed

cmd/go: go fmt should invoke gofmt from the current sdk installation #10755

zolotov opened this issue May 8, 2015 · 3 comments
Milestone

Comments

@zolotov
Copy link
Contributor

zolotov commented May 8, 2015

At https://github.com/golang/go/blob/master/src/cmd/go/fmt.go#L36 gofmt is invoked from PATH. So if I have several installations of Go then no matter which go fmt I invoke the gofmt from PATH will be used and it's not correct IMHO.

Unfortunately the fix like

 run(stringList(filepath.Join(runtime.GOROOT(), "bin/gofmt"), "-l", "-w", relPaths(pkg.allgofiles)))

won't work on apt-get (has no bin directory) and yum (gofmt is placed under bin/linux_64) installations.

@minux
Copy link
Member

minux commented May 8, 2015 via email

@zolotov
Copy link
Contributor Author

zolotov commented May 8, 2015

@minux thanks for reply, ok then, I'll make PR with the fix.

@gopherbot
Copy link

CL https://golang.org/cl/9900 mentions this issue.

@mikioh mikioh changed the title go fmt should invoke gofmt from the current sdk installation cmd/go: go fmt should invoke gofmt from the current sdk installation May 23, 2015
@mikioh mikioh added this to the Go1.5 milestone May 23, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants