Coder Social home page Coder Social logo

Comments (7)

syohex avatar syohex commented on September 27, 2024

You can avoid error by installing github.com/leanovate/gopter/gen.

% go get github.com/leanovate/gopter/gen

I suppose this caused bygo/importer. importer.Default().Import(path) which is used in gore for importing package finds only under $GOPATH/pkg. go get github.com/leanovate/gopter builds only $GOPATH/pkg/your_architecture/github.com/leanovate/gopter.a and does not build $GOPATH/pkg/your_architecture/github.com/leanovate/gopter/gen.a. So you got such error.

from gore.

ashb avatar ashb commented on September 27, 2024

I'm confused though - I can take the example gopter code and go run it fine. So what is run/build doing that gore is not?

from gore.

syohex avatar syohex commented on September 27, 2024

go run compiles source code and run it. While :import of gore loads package object file(*.a file on Linux system), it does not compile source code and not generate object file. :import commands raises error if there is no object file. So you need to generate object file before using :import command.

from gore.

ashb avatar ashb commented on September 27, 2024

Ahh right, that makes sense, thanks! I'm still kind of new to go. I managed to fix it via go install github.com/leanovate/gopter/gen

Is it possible that gore could notice that case and either run the install for me, or print a more understandable error message? I guess anything is possible, is it practical?

from gore.

syohex avatar syohex commented on September 27, 2024

Yes it is possible. Code is here.

https://github.com/motemen/gore/blob/603106957dbb1f054a60be39c4bc0c84cc060e44/commands.go#L84-L88

from gore.

motemen avatar motemen commented on September 27, 2024

Thanks both, yes it is the current behavior of gore to require :imported packages to be intalled, which causes such confusion. I think this could be fixed.

from gore.

zacacollier avatar zacacollier commented on September 27, 2024

I was wrestling with this for a while and could only get it to work by go getting the package I needed and then running gore from my home directory:

zac@lenovo ~ % go get github.com/aws/aws-sdk-go/aws/session
zac@lenovo ~ % gore
gore version 0.3.0  :help for help
gore> :import github.com/aws/aws-sdk-go/aws/session
gore> session.NewSession
(func(...*aws.Config) (*session.Session, error))(0x6efdb0)
gore>

@motemen I'd be happy to add this the README if you could provide a bit of context as to why this is the case?

from gore.

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.