You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.
This issue picks up a conversation with @sdboyer and @peterbourgon on Slack. It’s essentially a broader version of #348 amongst others.
Best illustrated by a commented, runnable example:
# setup a fresh projectcd`mktemp -d`export GOPATH=$PWD
mkdir -p src/github.com/myitcv/blah &&cd$_
dep init
# write some code that depends on github.com/pkg/errors, for example
cat <<-EOD > main.gopackage mainimport "fmt"import _ "github.com/pkg/errors"func main() { fmt.Println("Hello world")}EOD# now dep ensure to get the package dependency
dep ensure github.com/pkg/errors@ff09b135c25aae272398c51a07235b90a75aa4f0
# check the build passes
go build || (echo "Build failed cannot continue..."&& return)
# we cannot list information about package dependencies using their import pathecho"\$ go list -json github.com/pkg/errors"
go list -json github.com/pkg/errors
# ... nor can we run tests...echo"\$ go test github.com/pkg/errors"
go test github.com/pkg/errors
# ... nor can we run tests...echo"\$ go vet github.com/pkg/errors"
go vet github.com/pkg/errors
# ... nor can we install the package (imagine particularly if this were a main# package)...echo"\$ go install github.com/pkg/errors"
go install github.com/pkg/errors
# *******************************************************# the go tool does not generally work on dep dependencies# if we refer to them via their import paths# *******************************************************# instead we have to prefix the location of the vendorecho"\$ go list -json $(go list)/vendor/github.com/pkg/errors"
go list -json $(go list)/vendor/github.com/pkg/errors
echo"\$ go test $(go list)/vendor/github.com/pkg/errors"
go test$(go list)/vendor/github.com/pkg/errors
echo"\$ go vet $(go list)/vendor/github.com/pkg/errors"
go vet $(go list)/vendor/github.com/pkg/errors
echo"\$ go install $(go list)/vendor/github.com/pkg/errors"
go install $(go list)/vendor/github.com/pkg/errors
In short, I think the go tool should work on a project's dependencies.
The main reason being that we then don’t need to work out/reinvent how to install, test etc those packages, the go tool continues to be responsible for such tasks.
Edit (2017-04-13): removed the term "controlled" per @sdboyer in favour of simply describing these packages as the "project's dependencies"
The text was updated successfully, but these errors were encountered:
myitcv
changed the title
Feedback: should be able to use go tool on packages "controlled" by dep
Feedback: should be able to use go tool on a project's dependencies
Apr 13, 2017
This issue picks up a conversation with @sdboyer and @peterbourgon on Slack. It’s essentially a broader version of #348 amongst others.
Best illustrated by a commented, runnable example:
(see the output)
In short, I think the
go
tool should work on a project's dependencies.The main reason being that we then don’t need to work out/reinvent how to install, test etc those packages, the
go
tool continues to be responsible for such tasks.Edit (2017-04-13): removed the term "controlled" per @sdboyer in favour of simply describing these packages as the "project's dependencies"
The text was updated successfully, but these errors were encountered: