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

tools/cmd/go-contrib-init: panic if not in directory #21021

Closed
smcquay opened this issue Jul 15, 2017 · 1 comment
Closed

tools/cmd/go-contrib-init: panic if not in directory #21021

smcquay opened this issue Jul 15, 2017 · 1 comment

Comments

@smcquay
Copy link
Contributor

smcquay commented Jul 15, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version
go version devel +eab99a8d54 Mon Jun 26 21:12:22 2017 +0000 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/sm/go"
GORACE=""
GOROOT="/Users/sm/src/go"
GOTOOLDIR="/Users/sm/src/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/l6/16ml7k9d3j728cv1qnrwsp280000gn/T/go-build974224850=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

Following along with the gophercon workshop I ran go-contrib-init -repo scratch outside the scratch directory and the command panicked. The command worked if I cd'd into the scratch directory.

What did you expect to see?

go-contrib-init -repo scratch                                                                    
All good. Happy hacking!
Remember to squash your revised commits and preserve the magic Change-Id lines.
Next steps: https://golang.org/doc/contribute.html#commit_changes

What did you see instead?

go-contrib-init -repo scratch                                                             rc: 2  
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.detectrepo(0x60, 0x0)
        /Users/sm/src/golang.org/x/tools/cmd/go-contrib-init/contrib.go:54 +0x253
main.init()
        /Users/sm/src/golang.org/x/tools/cmd/go-contrib-init/contrib.go:27 +0x87
@smcquay
Copy link
Contributor Author

smcquay commented Jul 15, 2017

I seem to have had an older version of this tool; an update and rerun and things look good.

It appears this was fixed in 7a4327e

@smcquay smcquay closed this as completed Jul 15, 2017
@golang golang locked and limited conversation to collaborators Jul 15, 2018
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

2 participants