Closed derlio closed 9 years ago
Declcache is a thing that is responsible for parsing other than the current files in the package directory.
In other words.. is there any other files in the same directory as your example file? One of them may be as well incorrect.
Thanks , it works now. I saved some demo files in the same directory.
2015/08/07 10:46:28 ------------------------------------------------------- package main
import ( "fmt" )
var pow = []int{1, 2, 4, 8, 16, 32, 64, 128}
func main() { for i, v := range pow { fmt.Printf("2_%d = %d\n", i, v) } fmt.P# } 2015/08/07 10:46:28 ------------------------------------------------------- 2015/08/07 10:46:28 Found "fmt" at "/usr/local/Cellar/go/1.4.2/libexec/pkg/darwin_amd64/fmt.a" 2015/08/07 10:46:28 Found "fmt" at "/usr/local/Cellar/go/1.4.2/libexec/pkg/darwin_amd64/fmt.a" panic: runtime error: slice bounds out of range 1(runtime.call16): /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:401 2(runtime.gopanic): /usr/local/Cellar/go/1.4.2/libexec/src/runtime/panic.go:387 3(runtime.panicslice): /usr/local/Cellar/go/1.4.2/libexec/src/runtime/panic.go:18 4(main.path_and_alias): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/declcache.go:169 5(main.collect_package_imports): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/declcache.go:33 6(main.(_decl_file_cache).process_data): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/declcache.go:110 7(main.(_decl_file_cache).read_file): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/declcache.go:99 8(main.(_decl_file_cache).update): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/declcache.go:88 9(main.(decl_cache).get_and_update): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/declcache.go:354 10(main.func·004): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/autocompletecontext.go:397 2015/08/07 10:46:28 Found "fmt" at "/usr/local/Cellar/go/1.4.2/libexec/pkg/darwin_amd64/fmt.a" 2015/08/07 10:46:28 Found "fmt" at "/usr/local/Cellar/go/1.4.2/libexec/pkg/darwin_amd64/fmt.a" 11(runtime.goexit): /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:2232
2015/08/07 10:46:28 Found "fmt" at "/usr/local/Cellar/go/1.4.2/libexec/pkg/darwin_amd64/fmt.a" panic: One of the decl cache updaters panicked 1(runtime.call16): /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:401 2(runtime.gopanic): /usr/local/Cellar/go/1.4.2/libexec/src/runtime/panic.go:387 3(main.get_other_package_files): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/autocompletecontext.go:404 4(main.(_auto_complete_context).update_caches): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/autocompletecontext.go:159 5(main.(_auto_complete_context).apropos): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/autocompletecontext.go:252 6(main.server_auto_complete): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/server.go:155 7(main.(_RPC).RPC_auto_complete): /Users/liuzhongde/Develop/etc/mygo/src/github.com/nsf/gocode/rpc.go:26 8(runtime.call64): /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:403 9(reflect.Value.call): /usr/local/Cellar/go/1.4.2/libexec/src/reflect/value.go:419 10(reflect.Value.Call): /usr/local/Cellar/go/1.4.2/libexec/src/reflect/value.go:296 11(net/rpc.(_service).call): /usr/local/Cellar/go/1.4.2/libexec/src/net/rpc/server.go:382 12(runtime.goexit): /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:2232
2015/08/07 10:46:28 Found "fmt" at "/usr/local/Cellar/go/1.4.2/libexec/pkg/darwin_amd64/fmt.a" 2015/08/07 10:46:28 Found "fmt" at "/usr/local/Cellar/go/1.4.2/libexec/pkg/darwin_amd64/fmt.a" 2015/08/07 10:46:28 Found "fmt" at "/usr/local/Cellar/go/1.4.2/libexec/pkg/darwin_amd64/fmt.a" 2015/08/07 10:46:28 Found "fmt" at "/usr/local/Cellar/go/1.4.2/libexec/pkg/darwin_amd64/fmt.a"