GithubHelp home page GithubHelp logo

Comments (9)

brentp avatar brentp commented on May 23, 2024

I added a section to the readme on installation, please have a look and let me know if you have any questions.

from goleft.

sjackman avatar sjackman commented on May 23, 2024

go get doesn't seem to install any executables.

❯❯❯ GOPATH=~/.go go get -u github.com/brentp/goleft/...
package github.com/brentp/goleft/emdepth/mops: found packages mops (mops.go) and emdepth (mops_test.go) in /Users/sjackman/.go/src/github.com/brentp/goleft/emdepth/mops
❯❯❯ which goleft
goleft not found
❯❯❯ ls ~/.go/bin
ls: /Users/sjackman/.go/bin: No such file or directory

from goleft.

brentp avatar brentp commented on May 23, 2024

go get should get you what you need for development. If you want to install, you can run go install from the directory where goleft resides. How can I clarify this?

from goleft.

brentp avatar brentp commented on May 23, 2024

I can put the main into cmd/goleft/main.go and then go install should install the binary. I'll leave this open to track that change.

from goleft.

brentp avatar brentp commented on May 23, 2024

Please see the updated readme and re-open this issue if you have any problems. Thanks for bringing this to my attention.

from goleft.

sjackman avatar sjackman commented on May 23, 2024

I'd suggest add GOPATH and PATH to the installation instructions:

export GOPATH=~/.go
PATH="$GOPATH/bin:$PATH"
go get -u github.com/brentp/goleft/...
go install github.com/brentp/goleft/cmd/goleft
goleft --help
❯❯❯ GOPATH=~/.go go get -u github.com/brentp/goleft/...=
package github.com/brentp/goleft: no buildable Go source files in /Users/sjackman/.go/src/github.com/brentp/goleft

no buildable Go source files

Is that warning expected?

If you are using go, you can build from source with:

How do I build goleft from source? Is go install github.com/brentp/goleft/cmd/goleft installing a precompiled binary, or building from source?

Thanks for your help, Brent.

from goleft.

brentp avatar brentp commented on May 23, 2024

I'm hesitant to add more than I already have since most users would and should just copy the provided binary to their $PATH unless they are familiar with the go ecosystem.

yes:
go install github.com/brentp/goleft/cmd/goleft installs from source.

yes:
the warning is expected since the root go directory contains no source code by design.

I'll re-open this as a placeholder with the intent of adding an INSTALL-dev.md for those wishing to build from source.

from goleft.

sjackman avatar sjackman commented on May 23, 2024

for those wishing to build from source.

Perhaps I'm being pedantic, but go install github.com/brentp/goleft/cmd/goleft does install from source. How would the INSTALL-dev.md instructions differ from the README.md instructions?

I'm hesitant to add more than I already have

The README.md installation instructions should be sufficient to leave a working executable in the user's PATH. The current instructions yield:

❯❯❯ go get -u github.com/brentp/goleft/...
package github.com/brentp/goleft/...: cannot download, $GOPATH not set. For more details see: go help gopath

go help gopath yields 660 words. That badly needs a tl;dr summary, such as export GOPATH=~/.go. Someone familiar with the go ecosystem will know that they can skip this step.

since most users would and should just copy the provided binary to their $PATH

If so, then the installation instructions should include that step. It's currently not clear where the executable is installed, and it's not easy to copy an executable if you don't know where it is.

A suggestion:

export GOPATH=~/.go
go get -u github.com/brentp/goleft/...
go install github.com/brentp/goleft/cmd/goleft
~/.go/bin/goleft --help

Finally, copy the ~/.go/bin/goleft executable to a directory located in your $PATH, such as ~/bin.

from goleft.

brentp avatar brentp commented on May 23, 2024

I see what you mean, I have made another commit to clarify the point about install vs from source.

Installing go should give you a working go installation where any thing installed by go install will be on your path. that's why I consider additional explanation as something to be relegated to a more detailed document outside the readme (which I want to keep brief).

I'm more sticky on all of this because I want to promote that the preferred way to use is to download the binary. That said, I want it to be used so I'll accept PR's that clarify anything I've overlooked.

from goleft.

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.