Giter Site home page Giter Site logo

can't find package in gopath about gocode HOT 12 CLOSED

gameFu avatar gameFu commented on July 30, 2024
can't find package in gopath

from gocode.

Comments (12)

stamblerre avatar stamblerre commented on July 30, 2024 1

You should be able to build .a files by running go install <package>. You can use go install -i <package> to build the .a file for the package and its dependencies.

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

Do you have files like $GOPATH/pkg/darwin_amd64/bingo/monitor.a?

from gocode.

thatjames avatar thatjames commented on July 30, 2024

@stamblerre I finally stumbled upon this answer and I can say this is the issue my side, but I have no idea how to build these objects... How do we do so?


EDIT Managed to do it by tanking the pkg dir and rebuilding my directories. Is there a cleaner approach for this or are we waiting for the modules rewrite?

from gocode.

Vizualni avatar Vizualni commented on July 30, 2024

Having the same issue :/

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

@Vizualni: Do you have .a files under $GOPATH/pkg?

from gocode.

hilaily avatar hilaily commented on July 30, 2024

I have the same issue too. And there are no .a file in my $GOPATH/pkg.
I think it is because the new go cache. After go1.10, go install is not update cache in pkg file. Like this issue said nsf#500.
I tried go install -i, and it is work.

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

@laily123: Yes, goinstall -i is the correct solution to this problem.

from gocode.

sethgrid avatar sethgrid commented on July 30, 2024

I think this is related to #46.
I did a go get -u -v github.com/stamblerre/gocode and gocode close (might have done a gocode exit for good measure) and restarted gocode with gocode. I now have autocomplete in VS Code again.

I think my issue was the same as yours:
running $ gocode -s -debug
on line 12 of here, start to type c.

2019/02/03 08:35:40 Cursor at: 202
2019/02/03 08:35:40 -------------------------------------------------------
package main

import (
	"github.com/sethgrid/simplequest/dungeon"
)

func main() {
	// get config, run game
	d := dungeon.MakeDungeon()
	c := d.NewCell("0,1")
	c.Description("you are in a clearing")
	c.#
}
2019/02/03 08:35:40 -------------------------------------------------------
2019/02/03 08:35:40 Error parsing input file (outer block):
2019/02/03 08:35:40  /Users/sethammons/workspace/go/src/github.com/sethgrid/simplequest/cmd/quest/main.go:12:4: expected selector or type assertion, found ';'
2019/02/03 08:35:40 gbimporter: no package found for github.com/sethgrid/simplequest/dungeon: can't find import: "github.com/sethgrid/simplequest/dungeon"
2019/02/03 08:35:40 Elapsed duration: 464.741µs
2019/02/03 08:35:40 Offset: 0
2019/02/03 08:35:40 Number of candidates found: 0
2019/02/03 08:35:40 Candidates are:
2019/02/03 08:35:40 =======================================================

I tried this both in and out of my GOPATH. I'm not sure what the module system has done to my work set up, but things have been messed up for sure, and this made VS Code no more useful than an auto-formatter.

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

@sethgrid: For modules support, you should use stamblerre/gocode. mdempsky/gocode does not support modules. VSCode downloads both and renames the stamblerre/gocode binary to gocode-gomod, so both versions can coexist.

from gocode.

mengzhuo avatar mengzhuo commented on July 30, 2024

@stamblerre go install . under workspace works for me.

from gocode.

gameFu avatar gameFu commented on July 30, 2024

@stamblerre yes,this problem is loss .a file. go install this project genrate .a flie is the correct solution to this problem

from gocode.

zylikedream avatar zylikedream commented on July 30, 2024

is that means, every time I change my package, I have to install it ?

from gocode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.