Created
September 25, 2018 13:48
-
-
Save myitcv/a8977ab43dccf7a9c425ffde372c1e11 to your computer and use it in GitHub Desktop.
gocode issue repro script: no completions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GOPATH=$(mktemp -d) | |
cd $GOPATH | |
mkdir -p src/example.com/hello | |
cd src/example.com/hello | |
export GOBIN=$PWD/.bin | |
export PATH=$GOBIN:$PATH | |
echo "package main" > pkg.go | |
go get github.com/mdempsky/gocode | |
pushd $(go list -f "{{.Dir}}" github.com/mdempsky/gocode) | |
git checkout 00e7f5ac290aeb20a3d8d31e737ae560a191a1d5 | |
go install | |
popd | |
echo 'cGFja2FnZSBtYWluCgppbXBvcnQgKAoJImZsYWciCgkiZm10IgoJImdvL3R5cGVzIgoJIm9zIgoK | |
CSJnb2xhbmcub3JnL3gvdG9vbHMvZ28vcGFja2FnZXMiCikKCnR5cGUgRnJ1aXQgc3RydWN0IHsK | |
CU5hbWUgc3RyaW5nIGBoZWxsbzoid29ybGQiYAoJQWdlICBpbnQKfQoKdmFyIEJhbmFuYSAqRnJ1 | |
aXQKCmZ1bmMgbWFpbigpIHsKCWZsYWcuUGFyc2UoKQoKCS8vIE1hbnkgdG9vbHMgcGFzcyB0aGVp | |
ciBjb21tYW5kLWxpbmUgYXJndW1lbnRzIChhZnRlciBhbnkgZmxhZ3MpCgkvLyB1bmludGVycHJl | |
dGVkIHRvIHBhY2thZ2VzLkxvYWQgc28gdGhhdCBpdCBjYW4gaW50ZXJwcmV0IHRoZW0KCS8vIGFj | |
Y29yZGluZyB0byB0aGUgY29udmVudGlvbnMgb2YgdGhlIHVuZGVybHlpbmcgYnVpbGQgc3lzdGVt | |
LgoJY2ZnIDo9ICZwYWNrYWdlcy5Db25maWd7TW9kZTogcGFja2FnZXMuTG9hZFR5cGVzfQoJcGtn | |
cywgZXJyIDo9IHBhY2thZ2VzLkxvYWQoY2ZnLCBmbGFnLkFyZ3MoKS4uLikKCWlmIGVyciAhPSBu | |
aWwgewoJCWZtdC5GcHJpbnRmKG9zLlN0ZGVyciwgImxvYWQ6ICV2XG4iLCBlcnIpCgkJb3MuRXhp | |
dCgxKQoJfQoJaWYgcGFja2FnZXMuUHJpbnRFcnJvcnMocGtncykgPiAwIHsKCQlvcy5FeGl0KDEp | |
Cgl9CgoJcGtnIDo9IHBrZ3NbMF0KCgliYW5hbmEgOj0gcGtnLlR5cGVzLlNjb3BlKCkuTG9va3Vw | |
KCJCYW5hbmEiKQoKCWZtdC5QcmludGYoIiVUIDo6ICV2XG4iLCBiYW5hbmEuVHlwZSgpLCBiYW5h | |
bmEuVHlwZSgpKQoKCXggOj0gYmFuYW5hLlR5cGUoKS4oKnR5cGVzLlBvaW50ZXIpLkVsZW0oKS4o | |
KnR5cGVzLk5hbWVkKS5PYmooKS4KCWZtdC5QcmludGYoIiVUIDo6ICV2XG4iLCB4LCB4KQp9Cg==' | base64 --decode > main.go | |
cat main.go | |
offset=812 | |
tail -c +$offset main.go | |
gocode -in $PWD/main.go autocomplete $PWD/main.go $offset | |
offset=818 | |
tail -c +$offset main.go | |
gocode -in $PWD/main.go autocomplete $PWD/main.go $offset | |
echo 'cGFja2FnZSBtYWluCgppbXBvcnQgKAoJImZsYWciCgkiZm10IgoJImdvL3R5cGVzIgoJIm9zIgoK | |
CSJnb2xhbmcub3JnL3gvdG9vbHMvZ28vcGFja2FnZXMiCikKCnR5cGUgRnJ1aXQgc3RydWN0IHsK | |
CU5hbWUgc3RyaW5nIGBoZWxsbzoid29ybGQiYAoJQWdlICBpbnQKfQoKdmFyIEJhbmFuYSAqRnJ1 | |
aXQKCmZ1bmMgbWFpbigpIHsKCWZsYWcuUGFyc2UoKQoKCS8vIE1hbnkgdG9vbHMgcGFzcyB0aGVp | |
ciBjb21tYW5kLWxpbmUgYXJndW1lbnRzIChhZnRlciBhbnkgZmxhZ3MpCgkvLyB1bmludGVycHJl | |
dGVkIHRvIHBhY2thZ2VzLkxvYWQgc28gdGhhdCBpdCBjYW4gaW50ZXJwcmV0IHRoZW0KCS8vIGFj | |
Y29yZGluZyB0byB0aGUgY29udmVudGlvbnMgb2YgdGhlIHVuZGVybHlpbmcgYnVpbGQgc3lzdGVt | |
LgoJY2ZnIDo9ICZwYWNrYWdlcy5Db25maWd7TW9kZTogcGFja2FnZXMuTG9hZFR5cGVzfQoJcGtn | |
cywgZXJyIDo9IHBhY2thZ2VzLkxvYWQoY2ZnLCBmbGFnLkFyZ3MoKS4uLikKCWlmIGVyciAhPSBu | |
aWwgewoJCWZtdC5GcHJpbnRmKG9zLlN0ZGVyciwgImxvYWQ6ICV2XG4iLCBlcnIpCgkJb3MuRXhp | |
dCgxKQoJfQoJaWYgcGFja2FnZXMuUHJpbnRFcnJvcnMocGtncykgPiAwIHsKCQlvcy5FeGl0KDEp | |
Cgl9CgoJcGtnIDo9IHBrZ3NbMF0KCgliYW5hbmEgOj0gcGtnLlR5cGVzLlNjb3BlKCkuTG9va3Vw | |
KCJCYW5hbmEiKQoKCWZtdC5QcmludGYoIiVUIDo6ICV2XG4iLCBiYW5hbmEuVHlwZSgpLCBiYW5h | |
bmEuVHlwZSgpKQoKCXggOj0gYmFuYW5hLlR5cGUoKS4oKnR5cGVzLlBvaW50ZXIpLkVsZW0oKS4o | |
KnR5cGVzLk5hbWVkKS4KCWZtdC5QcmludGYoIiVUIDo6ICV2XG4iLCB4LCB4KQp9Cg==' | base64 --decode > main.go | |
cat main.go | |
offset=812 | |
tail -c +$offset main.go | |
gocode -in $PWD/main.go autocomplete $PWD/main.go $offset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment