A simple dependency manager for Go (golang), inspired by Bundler.

Goop

Goopie

A dependency manager for Go (golang), inspired by Bundler. It is different from other dependency managers in that it does not force you to mess with your GOPATH.

Getting Started

  1. Install Goop: go get github.com/nitrous-io/goop

  2. Create Goopfile. Revision reference (e.g. Git SHA hash) is optional, but recommended. Prefix hash with #. (This is to futureproof the file format.)

    Example:

    github.com/mattn/go-sqlite3
    github.com/gorilla/context #14f550f51af52180c2eefed15e5fd18d63c0a64a
    github.com/dotcloud/docker/pkg/proxy #v1.0.1 // comment
    github.com/gorilla/mux [email protected]:nitrous-io/mux.git // override repo url
    
  3. Run goop install. This will install packages inside a subdirectory called .vendor and create Goopfile.lock, recording exact versions used for each package and its dependencies. Subsequent goop install runs will ignore Goopfile and install the versions specified in Goopfile.lock. You should check this file in to your source version control. It's a good idea to add .vendor to your version control system's ignore settings (e.g. .gitignore).

  4. Run commands using goop exec (e.g. goop exec make). This will execute your command in an environment that has correct GOPATH and PATH set.

  5. Go commands can be run without the exec keyword (e.g. goop go test).

Other commands

  • Run goop update to ignore an existing Goopfile.lock, and update to latest versions of packages (as specified in Goopfile).

  • Running eval $(goop env) will modify GOPATH and PATH in current shell session, allowing you to run commands without goop exec.

Caveat

Goop currently only supports Git and Mercurial. This should be fine for 99% of the cases, but you are more than welcome to make a pull request that adds support for Subversion and Bazaar.


Work on awesome golang projects, like Goop, at Nitrous.IO

Copyright (c) 2014 Irrational Industries, Inc. d.b.a. Nitrous.IO.
This software is licensed under the MIT License.

Owner
Peter Jihoon Kim
@Coinbase @CoinbaseStablecoin @CoinbaseWallet Previously: Creator @CipherBrowser, @Nitrous-io, and @Specta
Peter Jihoon Kim
Comments
  • Goop cant clone private repository

    Goop cant clone private repository

    By default, Goop use go get -u [REPO], however go get -u cant fetch private dependencies.

    The workaround right now is to use .netrc file to specify credentials for the remote repository (i.e. github), but it would be nice to be able to specify a git src and use it.

  • Add

    Add "goop install package" support

    Features from this pull request

    By leverage the npm command, I added the package installation support to goop install, then you can use:

    • goop install to continue installing all packages from the local Goopfile file
    • goop install github.com/revel/revel to install one package you specified from the command line
    • goop install github.com/revel/revel #tag to install the package with the specified tag name

    And also, there is one new arg supported to the install command, which is --save-dev which is the same as npm,

    • goop install github.com/revel/revel --save-dev, the goop command will install the package github.com/revel/revel and it will also append the package github.com/revel/revel to the Goopfile file for convenient, or
    • goop install --save-dev github.com/revel/revel which is the same as goop install github.com/revel/revel --save-dev

    Changes are made

    Added the install arg support to the main.go file;

    Added one new method InstallPkg to goop/goop.go file, logic:

    • Create one tmp file ".Goopfile" and copy all the packages from "Goopfile" if it exists to ".Goopfile"
    • Append the new package to the end of this file
    • Call g.parseAndInstall(gftmp, true) to reuse the original logic to install the new packages in the file ".Goopfile"
    • If --save-dev is true, then mv the tmp file ".Goopfile" to "Goopfile"
  • Nested dependencies

    Nested dependencies

    I might be mistaken, but it seems that goop creates a lock file for the top level dependencies only. For example, if I list module 'A' as a dependency and it has module 'B' as a dependency, my lock file will contain a revision hash for module A but nothing about module B.

    Is that correct? If so, how can we make sure that changes to module B would not affect our locked versions in future?

  • Allow comments

    Allow comments

    Python developer here. You wouldn't believe how useful it is to allow comments on dependencies declarations, we do that all the time in the python world (in our requirements.txt files, used to install dependencies with the pip python tool). Things like "don't update to newer versions, this is the last compatible one", or "we are using this for feature/module x", etc.

  • Build packages with goop?

    Build packages with goop?

    I've been able to use goop with a trivial main.go example, but I've been unable to figure out how to use goop with a folder structure containing a package main and one or more other packages.

    My folder structure looks like below:

    Goopfile
    src/myproj
       - main.go
       - client/client.go
    

    I'm using goop go build src/myproj/main.go to build package main, but for the life of me I can't figure out how to build/import the client package. I would really appreciate an example that works.

  • auto parse deps

    auto parse deps

    if I add one dep in Goopfile, such as

    github.com/gohttp/app #5fe28eda25acc96b48d8f2ddb651ea9104cc3e7c
    

    I want to do goop install --auto-parse

    and the deps of github.com/gohttp/app will be parsed, and saved to Goopfile

    so, the result will be:

    github.com/gohttp/app #5fe28eda25acc96b48d8f2ddb651ea9104cc3e7c
    github.com/justinas/alice #e82c7d9ec9ebfd83e90d4fd39ce934f5fc0b0b5f
    github.com/bmizerany/pat #b8a35001b773c267eb260a691f4e5499a3531600
    
  • goop: readdirent: invalid argument

    goop: readdirent: invalid argument

    Go version: 1.3 OS: OS X

    Goopfile

    github.com/zenazn/goji
    

    Error message:

    => Installing github.com/zenazn/goji...
    WORK=/var/folders/cg/gtgtb84d4cx135ml8wtpc88r0000gn/T/go-build596648851
    mkdir -p $WORK/github.com/zenazn/goji/bind/_obj/
    mkdir -p $WORK/github.com/zenazn/goji/
    cd /private/tmp/test/.vendor/src/github.com/zenazn/goji/bind
    /usr/local/Cellar/go/1.3/libexec/pkg/tool/darwin_amd64/6g -o $WORK/github.com/zenazn/goji/bind.a -trimpath $WORK -p github.com/zenazn/goji/bind -complete -D _/private/tmp/test/.vendor/src/github.com/zenazn/goji/bind -I $WORK -pack ./bind.go ./einhorn.go ./systemd.go
    mkdir -p $WORK/github.com/zenazn/goji/graceful/_obj/
    cd /private/tmp/test/.vendor/src/github.com/zenazn/goji/graceful
    /usr/local/Cellar/go/1.3/libexec/pkg/tool/darwin_amd64/6g -o $WORK/github.com/zenazn/goji/graceful.a -trimpath $WORK -p github.com/zenazn/goji/graceful -complete -D _/private/tmp/test/.vendor/src/github.com/zenazn/goji/graceful -I $WORK -pack ./einhorn.go ./graceful.go ./middleware.go ./net.go ./signal.go
    mkdir -p $WORK/github.com/zenazn/goji/web/_obj/
    cd /private/tmp/test/.vendor/src/github.com/zenazn/goji/web
    /usr/local/Cellar/go/1.3/libexec/pkg/tool/darwin_amd64/6g -o $WORK/github.com/zenazn/goji/web.a -trimpath $WORK -p github.com/zenazn/goji/web -complete -D _/private/tmp/test/.vendor/src/github.com/zenazn/goji/web -I $WORK -pack ./atomic.go ./fast_router.go ./func_equal.go ./middleware.go ./mux.go ./pattern.go ./router.go ./web.go
    mkdir -p /private/tmp/test/.vendor/pkg/darwin_amd64/github.com/zenazn/goji/
    mv $WORK/github.com/zenazn/goji/bind.a /private/tmp/test/.vendor/pkg/darwin_amd64/github.com/zenazn/goji/bind.a
    mv $WORK/github.com/zenazn/goji/graceful.a /private/tmp/test/.vendor/pkg/darwin_amd64/github.com/zenazn/goji/graceful.a
    mv $WORK/github.com/zenazn/goji/web.a /private/tmp/test/.vendor/pkg/darwin_amd64/github.com/zenazn/goji/web.a
    mkdir -p $WORK/github.com/zenazn/goji/web/middleware/_obj/
    mkdir -p $WORK/github.com/zenazn/goji/web/
    cd /private/tmp/test/.vendor/src/github.com/zenazn/goji/web/middleware
    /usr/local/Cellar/go/1.3/libexec/pkg/tool/darwin_amd64/6g -o $WORK/github.com/zenazn/goji/web/middleware.a -trimpath $WORK -p github.com/zenazn/goji/web/middleware -complete -D _/private/tmp/test/.vendor/src/github.com/zenazn/goji/web/middleware -I $WORK -I /private/tmp/test/.vendor/pkg/darwin_amd64 -pack ./envinit.go ./logger.go ./middleware.go ./nocache.go ./options.go ./realip.go ./recoverer.go ./request_id.go ./terminal.go ./writer_proxy.go
    mkdir -p /private/tmp/test/.vendor/pkg/darwin_amd64/github.com/zenazn/goji/web/
    mv $WORK/github.com/zenazn/goji/web/middleware.a /private/tmp/test/.vendor/pkg/darwin_amd64/github.com/zenazn/goji/web/middleware.a
    mkdir -p $WORK/github.com/zenazn/goji/_obj/
    mkdir -p $WORK/github.com/zenazn/
    cd /private/tmp/test/.vendor/src/github.com/zenazn/goji
    /usr/local/Cellar/go/1.3/libexec/pkg/tool/darwin_amd64/6g -o $WORK/github.com/zenazn/goji.a -trimpath $WORK -p github.com/zenazn/goji -complete -D _/private/tmp/test/.vendor/src/github.com/zenazn/goji -I $WORK -I /private/tmp/test/.vendor/pkg/darwin_amd64 -pack ./default.go ./goji.go
    mkdir -p /private/tmp/test/.vendor/pkg/darwin_amd64/github.com/zenazn/
    mv $WORK/github.com/zenazn/goji.a /private/tmp/test/.vendor/pkg/darwin_amd64/github.com/zenazn/goji.a
    goop: readdirent: invalid argument
    
  • performed extract method refactoring on main.go

    performed extract method refactoring on main.go

    I thought that the main function in main.go could use a little refactoring. I'm new to Go, coming from Ruby, so this might not be the kind of thing done in this language, but I thought this might make the code a little more maintainable and expressive.

  • goop update: Revision-lock even with custom references.

    goop update: Revision-lock even with custom references.

    A separate moving branch (I.E. "develop", for git-flow style workflows) can given as a reference. Revision-locking for repeatable builds makes just as much sense, regardless of branch.

  • Unable to get

    Unable to get

    go get github.com/nitrous-io/goop
    package code.google.com/p/go.tools/go/vcs: Get https://code.google.com/p/go/source/checkout?repo=tools: x509: failed to load system roots and no roots provided
    

    Where did I go wrong?

  • Some minor tweaks around env activation

    Some minor tweaks around env activation

    This fixes #4 (set GOBIN) and #8 (replace GOPATH), and adds a "deactivate" command similar to the same command in virtualenv.

    You may or may not be interested in these changes, but I thought I'd throw them out there. A couple of thoughts:

    • deactivate is definitely useful, but only works for Bourne shell variants (sh, bash, zsh). Won't work for csh, fish, etc. It would be a bit more work to make it work across shells.
    • I'm not sure what your opinion on #4 and #8 are, so you might not want those changes. I can back them out.

    eg.

    Activate an environment:

    ~/Projects/3rdParty/goop$ goop env
    _OLD_GOPATH="$GOPATH"
    _OLD_GOBIN="$GOBIN"
    _OLD_PATH="$PATH"
    GOPATH=/Users/alec/Projects/3rdParty/goop/.vendor
    GOBIN=/Users/alec/Projects/3rdParty/goop/.vendor/bin
    PATH=/Users/alec/Projects/3rdParty/goop/.vendor/bin:/usr/local/bin:/usr/local/go/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/alec/.cabal/bin
    

    Deactivate an environment:

    ~/Projects/3rdParty/goop$ goop deactivate
    GOPATH="$_OLD_GOPATH"
    unset _OLD_GOPATH
    GOBIN="$_OLD_GOBIN"
    unset _OLD_GOBIN
    PATH="$_OLD_PATH"
    unset _OLD_PATH
    
  • warning for code.google.com shutting down

    warning for code.google.com shutting down

    warning: code.google.com is shutting down; import path code.google.com/p/go.tools/go/vcs will stop working

    receiving this error during goop install. is this library available through any other sources? thanks!

  • How to install new entry in Goopfile without updating existing dependencies?

    How to install new entry in Goopfile without updating existing dependencies?

    goop is so GREAT and I love it! Used it alot since I found it, thanks a lot for the tool.

    But I have a minor problem recurring in my development process, in the process I often need to add new dependencies to the project, but I have problems installing ONLY the new dependencies without touching others. The first thing I tried was adding an entry in the Goopfile then goop install, but goop install just ignore the changed Goopfile and picked-up the content of Goopfile.lock. Then I tried goop update, it do install the new dependencies, but as the help text indicates it also update all dependencies to latest version, I'd rather not to do it this way as it may compromise the stability of my project. Then I tried adding entries directly in Goopfile.lock then goop install, but this does not add entries of 'dependencies of dependencies' to the Goopfile.lock, thus leaving unlocked versions flying around.

    So what should I do in this situation? I think my use case is a very general one, so maybe there is already a way to do it and I missed it.

  • Consider adding GO15VENDOREXPERIMENT support

    Consider adding GO15VENDOREXPERIMENT support

    In 1.5 the go command will read the environment variable GO15VENDOREXPERIMENT. If enabled, it will use the local "/vendor/" folder for dependencies.

    Will you consider supporting this approach?

  • Incorrect dependency updates when fetching multiple dependencies from same GitHub repo

    Incorrect dependency updates when fetching multiple dependencies from same GitHub repo

    Hi there,

    I think I may have found a bug with how Goopfile works. It seems that if you have multiple dependencies located in the same GitHub repo, the individual dependencies must be listed in the order oldest to newest or else they do not get updated properly.

    For example, for my project called MumbleDJ, I need to fetch five dependencies: gumble, gumble_ffmpeg, gumbleutil, gcfg, and jsonq. If I put the dependencies in my Goopfile in this order, it does not completely update all of the dependencies (the commit specified for gumble is newer than the commit for gumble_ffmpeg, and gumble_ffmpeg is newer than gumbleutil):

    github.com/layeh/gumble/gumble #80248757d681a7563d7257ff645ea27250f9d42d
    github.com/layeh/gumble/gumble_ffmpeg #7ca5605a1e735c95442683ef47be117b0b9cb042
    github.com/layeh/gumble/gumbleutil #29411f8e62add7e8f0856b35dc925cf879be3aab
    code.google.com/p/gcfg #c2d3050044d0
    github.com/jmoiron/jsonq #7c27c8eb9f6831555a4209f6a7d579159e766a3c
    

    However, if I put them in this order, the updates are fetched correctly:

    github.com/layeh/gumble/gumbleutil #29411f8e62add7e8f0856b35dc925cf879be3aab
    github.com/layeh/gumble/gumble_ffmpeg #7ca5605a1e735c95442683ef47be117b0b9cb042
    github.com/layeh/gumble/gumble #80248757d681a7563d7257ff645ea27250f9d42d
    code.google.com/p/gcfg #c2d3050044d0
    github.com/jmoiron/jsonq #7c27c8eb9f6831555a4209f6a7d579159e766a3c
    

    The same dependencies and SHA hashes produce different results when put in different orders. Maybe I've missed something about how goop works, but it doesn't seem to make sense to me that the order of the dependencies in Goopfile should matter.

    Thanks!

Barebones dependency manager for Go.
Barebones dependency manager for Go.

Johnny Deps Johnny Deps is a small tool from VividCortex that provides minimalistic dependency versioning for Go repositories using Git. Its primary p

Sep 27, 2022
Go Package Manager (gopm) is a package manager and build tool for Go.

?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? In favor of Go Modules Proxy since Go 1.11, this pr

Dec 14, 2022
Go dependency management tool experiment (deprecated)
Go dependency management tool experiment (deprecated)

Dep dep is a dependency management tool for Go. It requires Go 1.9 or newer to compile. NOTE: Dep was an official experiment to implement a package ma

Dec 23, 2022
dependency tool for go

Godep - Archived Please use dep or another tool instead. The rest of this readme is preserved for those that may still need its contents. godep helps

Dec 14, 2022
Spaghetti: a dependency analysis tool for Go packages
Spaghetti: a dependency analysis tool for Go packages

Spaghetti is an interactive web-based tool to help you understand the dependencies of a Go program, and to explore and evaluate various possible efforts to eliminate dependencies.

Dec 15, 2022
Go Dependency Analysis toolkit

Goda is a Go dependency analysis toolkit. It contains tools to figure out what your program is using.

Jan 2, 2023
Golang Version Manager

g 注意:master分支可能处于开发之中并非稳定版本,请通过tag下载稳定版本的源代码,或通过release下载已编译的二进制可执行文件。 g是一个Linux、macOS、Windows下的命令行工具,可以提供一个便捷的多版本go环境的管理和切换。 特性 支持列出可供安装的go版本号 支持列出已安

Dec 30, 2022
Go Manager - bundle for go

gom - Go Manager Why The go get command is useful. But we want to fix the problem where package versions are different from the latest update. Are you

Nov 20, 2022
🦄 Easy, fast and open-source local package manager for Python!

Unikorn ?? Easy, fast and open-source local package manager for Python! Key Features Speed: You can add a package in one second.

Dec 11, 2021
gPac - a linux package manager

gPac is a useless package manager. It is included in the gSuite, which is a suite of tools written in GO. gPac is a KISS - like package manager.

Mar 13, 2022
GoFish is a cross-platform systems package manager, bringing the ease of use of Homebrew to Linux and Windows.

GoFish is a cross-platform systems package manager, bringing the ease of use of Homebrew to Linux and Windows.

Dec 11, 2022
Package manager for future projects

PCKGER is a package manager for my next project but when it will be able to build binaries and move libs it will be used like a normal package manager

Dec 20, 2021
gobin is a package manager for /go/bin

gobin gobin is a package manager for /go/bin Features List installed packages. Check for updates. Install packages (like go install). Uninstall packag

Nov 12, 2022
📦 An independent package manager for compiled binaries.
📦 An independent package manager for compiled binaries.

stew An independent package manager for compiled binaries. Features Easily distribute binaries across teams and private repositories. Get the latest r

Dec 13, 2022
Package Management for Golang
Package Management for Golang

Glide: Vendor Package Management for Golang Are you used to tools such as Cargo, npm, Composer, Nuget, Pip, Maven, Bundler, or other modern package ma

Dec 27, 2022
Fetch license information for all direct and indirect dependencies of your Golang project
Fetch license information for all direct and indirect dependencies of your Golang project

gocomply beta Give open source Golang developers the credit they deserve, follow your legal obligations, and save time with gocomply. This tiny little

Nov 1, 2022
An extremely fast JavaScript bundler and minifier
An extremely fast JavaScript bundler and minifier

An extremely fast JavaScript bundler and minifier

Jan 4, 2023
Barebones dependency manager for Go.
Barebones dependency manager for Go.

Go Package Manager Go Package Manager (or gpm, for short) is a tool that helps achieve reproducible builds for Go applications by specifying the revis

Dec 14, 2022
Barebones dependency manager for Go.
Barebones dependency manager for Go.

Johnny Deps Johnny Deps is a small tool from VividCortex that provides minimalistic dependency versioning for Go repositories using Git. Its primary p

Sep 27, 2022
Podman based development-only dependency manager for Linux.

Tent is a CLI tool for running development dependencies such as MySQL, Mongo, ElasticSearch etc inside pre-configured containers using simple one

Aug 30, 2022