pax_global_header 0000666 0000000 0000000 00000000064 13171666371 0014525 g ustar 00root root 0000000 0000000 52 comment=8ddfc8afb2d520d41997ebddd921b52152706c01
dep-0.3.2/ 0000775 0000000 0000000 00000000000 13171666371 0012277 5 ustar 00root root 0000000 0000000 dep-0.3.2/.codeclimate.yml 0000664 0000000 0000000 00000000360 13171666371 0015350 0 ustar 00root root 0000000 0000000 engines:
gofmt:
enabled: true
govet:
enabled: true
golint:
enabled: true
ratings:
paths:
- "**.go"
exclude_paths:
- vendor/
- internal/gps/_testdata
- cmd/dep/testdata
- testdata
- internal/gps/internal/pb
dep-0.3.2/.gitattributes 0000664 0000000 0000000 00000000120 13171666371 0015163 0 ustar 00root root 0000000 0000000 # Prevent problems comparing golden files on Windows
**/testdata/** text eol=lf
dep-0.3.2/.github/ 0000775 0000000 0000000 00000000000 13171666371 0013637 5 ustar 00root root 0000000 0000000 dep-0.3.2/.github/CODEOWNERS 0000664 0000000 0000000 00000001465 13171666371 0015240 0 ustar 00root root 0000000 0000000 # general
* @sdboyer
# init
/cmd/dep/init* @carolynvs
/cmd/dep/gopath_scanner* @carolynvs
/cmd/dep/root_analyzer* @carolynvs
/cmd/dep/testdata/init @carolynvs
/cmd/dep/testdata/harness_tests/init @carolynvs
/internal/importers @carolynvs
/analyzer* @carolynvs
/testdata/analyzer @carolynvs
/internal/feedback @carolynvs
# ensure
/cmd/dep/ensure* @ibrasho
/cmd/dep/testdata/harness_tests/ensure** @ibrasho
# status
/cmd/dep/status* @darkowlzz
/cmd/dep/testdata/harness_tests/status** @darkowlzz
/cmd/dep/graphviz* @darkowlzz
# gps caching
/internal/gps/source_cache* @jmank88
dep-0.3.2/.github/ISSUE_TEMPLATE.md 0000664 0000000 0000000 00000001210 13171666371 0016336 0 ustar 00root root 0000000 0000000
### What version of `dep` are you using (`dep version`)?
### What `dep` command did you run?
### What did you expect to see?
### What did you see instead?
dep-0.3.2/.github/PULL_REQUEST_TEMPLATE.md 0000664 0000000 0000000 00000001042 13171666371 0017435 0 ustar 00root root 0000000 0000000
### What does this do / why do we need it?
### What should your reviewer look out for in this PR?
### Do you need help or clarification on anything?
### Which issue(s) does this PR fix?
dep-0.3.2/.gitignore 0000664 0000000 0000000 00000000517 13171666371 0014272 0 ustar 00root root 0000000 0000000 # dep project generated files to ignore
# if you want to ignore files created by your editor/tools,
# please consider a global .gitignore https://help.github.com/articles/ignoring-files
# please do not open a pull request to add something created by your editor or tools
/dep
/testdep
/dep.exe
/licenseok
/profile.out
/coverage.txt
dep-0.3.2/.travis.yml 0000664 0000000 0000000 00000005763 13171666371 0014423 0 ustar 00root root 0000000 0000000 language: go
sudo: false
notifications:
email: false
jobs:
include:
- stage: test
go_import_path: github.com/golang/dep
install:
- go get -u github.com/golang/lint/golint honnef.co/go/tools/cmd/megacheck
- npm install -g codeclimate-test-reporter
env:
- DEPTESTBYPASS501=1
os: linux
go: 1.9.x
script:
- go test -i ./...
- ./hack/lint.bash
- ./hack/validate-vendor.bash
- ./hack/validate-licence.bash
- ./hack/coverage.bash
after_success:
- codeclimate-test-reporter < coverage.txt
# YAML alias, for settings shared across the simpler builds
- &simple-test
go: 1.8.x
stage: test
go_import_path: github.com/golang/dep
install: skip
env:
- DEPTESTBYPASS501=1
script: go test -race $(go list ./... | grep -v vendor)
- <<: *simple-test
go: tip
- <<: *simple-test
os: osx
go: 1.9.x
install:
# brew takes horribly long to update itself despite the above caching
# attempt; only bzr install if it's not on the $PATH
- test $(which bzr) || brew install bzr
env:
- HOMEBREW_NO_AUTO_UPDATE=1
- DEPTESTBYPASS501=1
script:
# OSX as of El Capitan sets an exit trap that interacts poorly with how
# travis seems to spawn these shells; if set -e is set, then it can cause
# build failures. We're not doing that here, but retain the trap statement
# for future safety.
# Related: https://superuser.com/questions/1044130/why-am-i-having-how-can-i-fix-this-error-shell-session-update-command-not-f
- trap EXIT
- go test -race ./...
- go: 1.9.x
stage: deploy
go_import_path: github.com/golang/dep
install: skip
script: skip
before_deploy:
- ./hack/build-all.bash
deploy:
- provider: releases
api_key:
secure: fL9GX11J3JLizEBTPZHN32wuAT91eAJsGl0kjlAdIc6Lb/9UCe1XZGgFnpQFN4qo/S+omhHBDbM6Ty1xhNy7xmjDecpQGDU8Rmap9Oll0TuxqMigG+njOuPp5VUYPofPP0PGKdxAcYg+KaFM7x0o2rK+qA046NHwo2gH1BbE+bn55TZglEajEfc8j9iX4jt96KC7zlu+WiKArLmfUtlrI8m8ZYgbYcvFmlYjeCiEqlNhvNL59ejug9Rl0PLtPbamqVXkGLafYtekgPCb4WSxBiCt8pq5Rb5svk9YcdXpiaWQhZjMPAuKN6BrmN2lw1PiXzADUG5fjvNc8eo2HY70GD2utU9cAsY8VIafhoH5n6uM1WI8MHwDfd7P1PiQA3ZGQ8CPwk4q/8HSfQU9ap7vZgSF63pTIbtlviyIG67orOJE9PWWncl9olYM946UylZu6m3hWI/rmJxOeJ1UJjym/3GNPMRfKubaGhV/TyRdM0bKX4M0cXHU6k/ESVFupGXdKRt4RpvkD4/1Km6b2OShW6PNI+ifFspnJr7obkI7dm7ubySdnNz4lMv9WWymxRpMVc8hUAhuoDvXeZJq7pSnkjBEWDxIRoTkA93CU3/Rf7MFYCJMnGSqjcxWUpIfCAk2/r4BqL9NQnqBvvVt+MYi64QaD5n7ZF3dVbr6HZ2zjSU=
file:
- release/dep-linux-amd64
- release/dep-linux-amd64.sha256
- release/dep-darwin-amd64
- release/dep-darwin-amd64.sha256
- release/dep-windows-amd64
- release/dep-windows-amd64.sha256
skip_cleanup: true
on:
repo: golang/dep
branch: master
tags: true
dep-0.3.2/AUTHORS 0000664 0000000 0000000 00000000255 13171666371 0013351 0 ustar 00root root 0000000 0000000 # This source code refers to The Go Authors for copyright purposes.
# The master list of authors is in the main Go distribution,
# visible at http://tip.golang.org/AUTHORS.
dep-0.3.2/CHANGELOG.md 0000664 0000000 0000000 00000006213 13171666371 0014112 0 ustar 00root root 0000000 0000000 # v0.3.2 (Unreleased)
NEW FEATURES:
* Add support for importing from [gvt](https://github.com/FiloSottile/gvt)
and [gb](https://godoc.org/github.com/constabulary/gb/cmd/gb-vendor).
(#1149)
* Wildcard ignore support. (#1156)
* Disable SourceManager lock by setting `DEPNOLOCK` environment variable.
(#1206)
* `dep ensure -no-vendor -dry-run` now exits with an error when changes would
have to be made to `Gopkg.lock`. This is useful for CI. (#1256)
BUG FIXES:
* gps: Fix case mismatch error with multiple dependers. (#1233)
* Skip broken `vendor` symlink rather than returning an error. (#1191)
* Fix `status` shows incorrect reason for lock mismatch when ignoring packages.
(#1216)
IMPROVEMENTS:
* Allow `dep ensure -add` and `-update` when lock is out-of-sync. (#1225)
* gps: vcs: Dedupe git version list (#1212)
* gps: Add prune functions to gps. (#1020)
* gps: Skip broken vendor symlinks. (#1191)
* `dep ensure -add` now concurrently fetches the source and adds the projects.
(#1218)
* File name case check is now performed on `Gopkg.toml` and `Gopkg.lock`.
(#1114)
* gps: gps now supports pruning. (#1020)
* `dep ensure -update` now concurrently validates the passed project arguments.
Improving performance when updating dependencies with `-update`. (#1175)
* `dep status` now concurrently fetches repo info. Improving status performance.
(#1135)
* gps: Add SourceURLsForPath() to SourceManager. (#1166)
* gps: Include output in error. (#1180)
WIP:
* gps: Process canonical import paths. (#1017)
* gps: Persistent cache. (#1127, #1215)
# v0.3.1
* gps: Add satisfiability check for case variants (#1079)
* Validate Project Roots in manifest (#1116)
* gps: Properly separate sources for different gopkg.in versions & github
(#1132)
* gps: Add persistent BoltDB cache (#1098)
* gps: Increase default subcommand timeout to 30s (#1087)
* Fix importer [issue](https://github.com/golang/dep/issues/939) where the
importer would drop the imported version of a project (#1100)
* Import analyzer now always uses the same name, fixing the lock mismatch
immediately after dep init issue (#1099)
* Add support for importing from [govend](https://github.com/govend/govend)
(#1040) and [LK4D4/vndr](https://github.com/LK4D4/vndr) (#978) based projects
* gps: gps no longer assumes that every git repo has a HEAD (#1053)
* `os.Chmod` failures on Windows due to long path length has been fixed (#925)
* Add `version` command (#996)
* Drop support for building with go1.7 (#714)
* gps: Parse abbreviated git revisions (#1027)
* gps: Parallelize writing dep tree (#1021)
* `status` now shows the progress in verbose mode (#1009, #1037)
* Fix empty `Constraint` and `Version` in `status` json output (#976)
* `status` table output now shows override constraints (#918)
* gps: Display warning message every 15 seconds when lockfile is busy (#958)
* gps: Hashing directory tree and tree verification (#959)
* `ensure` now has `-vendor-only` mode to populate vendor/ without updating
Gopkg.lock (#954)
* Use fork of Masterminds/semver until
Masterminds/semver [issue#59](https://github.com/Masterminds/semver/issues/59)
is fixed upstream (#938)
* gps: Ensure packages are deducible before attempting to solve (#697)
dep-0.3.2/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000006237 13171666371 0015106 0 ustar 00root root 0000000 0000000 # Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual identity
and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening,
offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at sam (at) samboyer.org. All complaints
will be reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. The project team is obligated to
maintain confidentiality with regard to the reporter of an incident. Further
details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
dep-0.3.2/CONTRIBUTING.md 0000664 0000000 0000000 00000017602 13171666371 0014536 0 ustar 00root root 0000000 0000000 # Contributing to `dep`
`dep` is an open source project.
It is the work of hundreds of contributors. We appreciate your help!
Keep an eye on the [Roadmap](https://github.com/golang/dep/wiki/Roadmap) for a summary of where the project is, and where we're headed.
## Filing issues
Please check the existing issues and [FAQ](docs/FAQ.md) to see if your feedback has already been reported.
When [filing an issue](https://github.com/golang/dep/issues/new), make sure to answer these five questions:
1. What version of Go (`go version`) and `dep` (`git describe --tags`) are you using??
3. What `dep` command did you run?
4. What did you expect to see?
5. What did you see instead?
General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.
The gophers there will answer or ask you to file an issue if you've tripped over a bug.
## Contributing code
Let us know if you are interested in working on an issue by leaving a comment
on the issue in GitHub. This helps avoid multiple people unknowingly
working on the same issue.
Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html)
before sending patches.
The
[help wanted](https://github.com/golang/dep/issues?q=is%3Aissue+is%3Aopen+label%3A%22help%20wanted%22)
label highlights issues that are well-suited for folks to jump in on. The
[good first issue](https://github.com/golang/dep/issues?q=is%3Aissue+is%3Aopen+label%3A%22good%20first%20issue%22)
label further identifies issues that are particularly well-sized for newcomers.
Unless otherwise noted, the `dep` source files are distributed under
the BSD-style license found in the LICENSE file.
All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult [GitHub Help] for more
information on using pull requests.
We check `dep`'s own `vendor` directory into git. For any PR to `dep` where you're
updating `Gopkg.toml`, make sure to run `dep ensure` and
([for now](https://github.com/golang/dep/issues/944)) `dep prune` and commit all
changes to `vendor`.
[GitHub Help]: https://help.github.com/articles/about-pull-requests/
## Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution,
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to to see
your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.
## Maintainer's Guide
`dep` has subsystem maintainers; this guide is intended for them in performing their work as a maintainer.
### General guidelines
* _Be kind, respectful, and inclusive_. Really live [that CoC](https://github.com/golang/dep/blob/master/CODE_OF_CONDUCT.md). We've developed a reputation as one of the most welcoming and supportive project environments in the Go community, and we want to keep that up!
* The lines of responsibility between maintainership areas can be fuzzy. Get to know your fellow maintainers - it's important to work _with_ them when an issue falls in this grey area.
* Remember, the long-term goal of `dep` is to disappear into the `go` toolchain. That's going to be a challenging process, no matter what. Minimizing that eventual difficulty should be a guiding light for all your decisions today.
* Try to match the toolchain's assumptions as closely as possible ([example](https://github.com/golang/dep/issues/564#issuecomment-300994599)), and avoid introducing new rules the toolchain would later have to incorporate.
* Every new flag or option in the metadata files is more exposed surface area that demands conversion later. Only add these with a clear design plan.
* `dep` is experimental, but increasingly only on a larger scale. Experiments need clear hypotheses and parameters for testing - nothing off-the-cuff.
* Being a maintainer doesn't mean you're always right. Admitting when you've made a mistake keeps the code flowing, the environment health, and the respect level up.
* It's fine if you need to step back from maintainership responsibilities - just, please, don't fade away! Let other maintainers know what's going on.
### Issue management
* We use [Zenhub](https://www.zenhub.com) to manage the queue, in addition to what we do with labels.
* You will need to install [ZenHub extension](https://www.zenhub.com/extension) to your browser to show the board.
* Pipelines, and [the board](https://github.com/golang/dep#boards) are one thing we try to utilize:
* **New Issues Pipeline**: When someone creates a new issue, it goes here first. Keep an eye out for issues that fall into your area. Add labels to them, and if it's something we should do, put it in the `Backlog` pipeline. If you aren't sure, throw it in the `Icebox`. It helps to sort this pipeline by date.
* **Icebox Pipeline**: Issues that we aren't immediately closing but aren't really ready to be prioritized and started on. It's not a wontfix bucket, but a "not sure if we should/can fix right now" bucket.
* **Backlog Pipeline**: Issues that we know we want to tackle. You can drag/drop up and down to prioritize issues.
* Marking dependencies/blockers is also quite useful where appropriate; please do that.
* We use epics and milestones in roughly the same way (because OSS projects don't have real sprints). Epics should be duplicated as milestones; if there's a main epic issue, it should contain a checklist of the relevant issues to complete it.
* The `area:` labels correspond to maintainership areas. Apply yours to any issues or PRs that fall under your purview. It's to be expected that multiple `area:` labels may be applied to a single issue.
* The [`help-wanted`](https://github.com/golang/dep/issues?q=is%3Aissue+is%3Aopen+label%3Ahelp-wanted) and [`good-first-pr`](https://github.com/golang/dep/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-pr) labels are two of our most important tools for making the project accessible to newcomers - a key goal for our community. Here's how to use them well.
* `good-first-pr` should be applied when there's a very straightforward, self-contained task that is very unlikely to have any hidden complexity. The real purpose of these is to provide a "chink in the armor", providing newcomers a lens through which to start understanding the project.
* `help-wanted` should be applied to issues where there's a clear, stated goal, there is at most one significant question that needs answering, and it looks like the implementation won't be inordinately difficult, or disruptive to other parts of the system.
* `help-wanted` should also be applied to all `good-first-pr` issues - it's duplicative, but not doing so seems unfriendly.
### Pull Requests
* Try to make, and encourage, smaller pull requests.
* [No is temporary. Yes is forever.](https://blog.jessfraz.com/post/the-art-of-closing/)
* Long-running feature branches should generally be avoided. Discuss it with other maintainers first.
* Unless it's trivial, don't merge your own PRs - ask another maintainer.
* Commit messages should follow [Tim Pope's rules](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
* Checklist for merging PRs:
* Does the PR pass [the code review comments](https://github.com/golang/go/wiki/CodeReviewComments)? (internalize these rules!)
* Are there tests to cover new or changed behavior? Prefer reliable tests > no tests > flaky tests.
* Does the first post in the PR contain "Fixes #..." text for any issues it resolves?
* Are any necessary follow-up issues _already_ posted, prior to merging?
* Does this change entail the updating of any docs?
* For docs kept in the repo, e.g. FAQ.md, docs changes _must_ be submitted as part of the same PR.
dep-0.3.2/CONTRIBUTORS 0000664 0000000 0000000 00000000252 13171666371 0014156 0 ustar 00root root 0000000 0000000 # This source code was written by the Go contributors.
# The master list of contributors is in the main Go distribution,
# visible at http://tip.golang.org/CONTRIBUTORS.
dep-0.3.2/Gopkg.lock 0000664 0000000 0000000 00000005007 13171666371 0014222 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "parse-constraints-with-dash-in-pre"
name = "github.com/Masterminds/semver"
packages = ["."]
revision = "a93e51b5a57ef416dac8bb02d11407b6f55d8929"
source = "https://github.com/carolynvs/semver.git"
[[projects]]
name = "github.com/Masterminds/vcs"
packages = ["."]
revision = "3084677c2c188840777bff30054f2b553729d329"
version = "v1.11.1"
[[projects]]
branch = "master"
name = "github.com/armon/go-radix"
packages = ["."]
revision = "4239b77079c7b5d1243b7b4736304ce8ddb6f0f2"
[[projects]]
name = "github.com/boltdb/bolt"
packages = ["."]
revision = "2f1ce7a837dcb8da3ec595b1dac9d0632f0f99e8"
version = "v1.3.1"
[[projects]]
branch = "v2"
name = "github.com/go-yaml/yaml"
packages = ["."]
revision = "cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b"
[[projects]]
branch = "master"
name = "github.com/golang/protobuf"
packages = ["proto"]
revision = "5afd06f9d81a86d6e3bb7dc702d6bd148ea3ff23"
[[projects]]
name = "github.com/jmank88/nuts"
packages = ["."]
revision = "a1e02c788669d022c325a8ee674f15360d7104f4"
version = "v0.2.0"
[[projects]]
branch = "master"
name = "github.com/nightlyone/lockfile"
packages = ["."]
revision = "e83dc5e7bba095e8d32fb2124714bf41f2a30cb5"
[[projects]]
name = "github.com/pelletier/go-buffruneio"
packages = ["."]
revision = "c37440a7cf42ac63b919c752ca73a85067e05992"
version = "v0.2.0"
[[projects]]
branch = "master"
name = "github.com/pelletier/go-toml"
packages = ["."]
revision = "fe206efb84b2bc8e8cfafe6b4c1826622be969e3"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
branch = "master"
name = "github.com/sdboyer/constext"
packages = ["."]
revision = "836a144573533ea4da4e6929c235fd348aed1c80"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = ["context"]
revision = "66aacef3dd8a676686c7ae3716979581e8b03c47"
[[projects]]
branch = "master"
name = "golang.org/x/sync"
packages = ["errgroup"]
revision = "f52d1811a62927559de87708c8913c1650ce4f26"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix"]
revision = "bb24a47a89eac6c1227fbcb2ae37a8b9ed323366"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "05c1cd69be2c917c0cc4b32942830c2acfa044d8200fdc94716aae48a8083702"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/Gopkg.toml 0000664 0000000 0000000 00000001223 13171666371 0014241 0 ustar 00root root 0000000 0000000 [[constraint]]
branch = "parse-constraints-with-dash-in-pre"
name = "github.com/Masterminds/semver"
source = "https://github.com/carolynvs/semver.git"
[[constraint]]
name = "github.com/Masterminds/vcs"
version = "1.11.0"
[[constraint]]
branch = "v2"
name = "github.com/go-yaml/yaml"
[[constraint]]
branch = "master"
name = "github.com/pelletier/go-toml"
[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.0"
[[constraint]]
name = "github.com/boltdb/bolt"
version = "1.0.0"
[[constraint]]
name = "github.com/jmank88/nuts"
version = "0.2.0"
[[constraint]]
name = "github.com/golang/protobuf"
branch = "master"
dep-0.3.2/LICENSE 0000664 0000000 0000000 00000002707 13171666371 0013312 0 ustar 00root root 0000000 0000000 Copyright (c) 2014 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dep-0.3.2/MAINTAINERS.md 0000664 0000000 0000000 00000000700 13171666371 0014370 0 ustar 00root root 0000000 0000000
General maintainers:
sam boyer (@sdboyer)
* dep
* `init` command: Carolyn Van Slyck (@carolynvs)
* `ensure` command: Ibrahim AshShohail (@ibrasho)
* `status` command: Sunny (@darkowlzz)
* testing harness: (vacant)
* gps
* solver: (vacant)
* source manager: (vacant)
* root deduction: (vacant)
* source/vcs interaction: (vacant)
* caching: Jordan Krage (@jmank88)
* pkgtree: (vacant)
* versions and constraints: (vacant)
dep-0.3.2/PATENTS 0000664 0000000 0000000 00000002427 13171666371 0013345 0 ustar 00root root 0000000 0000000 Additional IP Rights Grant (Patents)
"This implementation" means the copyrightable works distributed by
Google as part of the Go project.
Google hereby grants to You a perpetual, worldwide, non-exclusive,
no-charge, royalty-free, irrevocable (except as stated in this section)
patent license to make, have made, use, offer to sell, sell, import,
transfer and otherwise run, modify and propagate the contents of this
implementation of Go, where such license applies only to those patent
claims, both currently owned or controlled by Google and acquired in
the future, licensable by Google that are necessarily infringed by this
implementation of Go. This grant does not include claims that would be
infringed only as a consequence of further modification of this
implementation. If you or your agent or exclusive licensee institute or
order or agree to the institution of patent litigation against any
entity (including a cross-claim or counterclaim in a lawsuit) alleging
that this implementation of Go or any code incorporated within this
implementation of Go constitutes direct or contributory patent
infringement, or inducement of patent infringement, then any patent
rights granted to you under this License for this implementation of Go
shall terminate as of the date such litigation is filed.
dep-0.3.2/README.md 0000664 0000000 0000000 00000027067 13171666371 0013572 0 ustar 00root root 0000000 0000000

## Dep
`dep` is a prototype dependency management tool for Go. It requires Go 1.8 or newer to compile.
`dep` is the official _experiment_, but not yet the official tool. Check out the [Roadmap](https://github.com/golang/dep/wiki/Roadmap) for more on what this means!
## Current status
`dep` is safe for production use. That means two things:
* Any valid metadata file (`Gopkg.toml` and `Gopkg.lock`) will be readable and considered valid by any future version of `dep`.
* The CLI UI is mostly stable. `dep init` and `dep ensure` are mostly set; `dep status` is likely to change a fair bit, and `dep prune` is [going to be absorbed into `dep ensure`](https://github.com/golang/dep/issues/944).
That said, keep in mind the following:
* `dep init` on an existing project can be a rocky experience - we try to automatically convert from other tools' metadata files, and that process is often complex and murky. Once your project is converted and you're using `dep ensure`, its behavior is quite stable.
* `dep` still has nasty bugs, but in general these are comparable or fewer to other tools out there.
* `dep` is [pretty slow right now](https://github.com/golang/dep/blob/master/docs/FAQ.md#why-is-dep-slow), especially on the first couple times you run it. Just know that there is a _lot_ of headroom for improvement, and work is actively underway.
* `dep` is still changing rapidly. If you need stability (e.g. for CI), it's best to rely on a released version, not tip.
* `dep`'s exported API interface will continue to change in unpredictable, backwards-incompatible ways until we tag a v1.0.0 release.
## Context
- [The Saga of Go Dependency Management](https://blog.gopheracademy.com/advent-2016/saga-go-dependency-management/)
- Official Google Docs
- [Go Packaging Proposal Process](https://docs.google.com/document/d/18tNd8r5DV0yluCR7tPvkMTsWD_lYcRO7NhpNSDymRr8/edit)
- [User Stories](https://docs.google.com/document/d/1wT8e8wBHMrSRHY4UF_60GCgyWGqvYye4THvaDARPySs/edit)
- [Features](https://docs.google.com/document/d/1JNP6DgSK-c6KqveIhQk-n_HAw3hsZkL-okoleM43NgA/edit)
- [Design Space](https://docs.google.com/document/d/1TpQlQYovCoX9FkpgsoxzdvZplghudHAiQOame30A-v8/edit)
- [Frequently Asked Questions](docs/FAQ.md)
## Setup
Grab the latest binary from the [releases](https://github.com/golang/dep/releases) page.
On macOS you can install or upgrade to the latest released version with Homebrew:
```sh
$ brew install dep
$ brew upgrade dep
```
If you're interested in hacking on `dep`, you can install via `go get`:
```sh
go get -u github.com/golang/dep/cmd/dep
```
To start managing dependencies using dep, run the following from your project's root directory:
```sh
$ dep init
```
This does the following:
1. Look for [existing dependency management files](docs/FAQ.md#what-external-tools-are-supported) to convert
1. Check if your dependencies use dep
1. Identify your dependencies
1. Back up your existing `vendor/` directory (if you have one) to
`_vendor-TIMESTAMP/`
1. Pick the highest compatible version for each dependency
1. Generate [`Gopkg.toml`](docs/Gopkg.toml.md) ("manifest") and `Gopkg.lock` files
1. Install the dependencies in `vendor/`
## Usage
There is one main subcommand you will use: `dep ensure`. `ensure` first checks that `Gopkg.lock` is consistent with `Gopkg.toml` and the `import`s in your code. If any
changes are detected, `dep`'s solver works out a new `Gopkg.lock`. Then, `dep` checks if the contents of `vendor/` are what `Gopkg.lock` (the new one if applicable, else the existing one) says it should be, and rewrites `vendor/` as needed to bring it into line.
In essence, `dep ensure` [works in two phases to keep four buckets of state in sync](https://youtu.be/5LtMb090AZI?t=20m4s):
_Note: until we ship [vendor verification](https://github.com/golang/dep/issues/121), we can't efficiently perform the `Gopkg.lock` <-> `vendor/` comparison, so `dep ensure` unconditionally regenerates all of `vendor/` to be safe._
`dep ensure` is safe to run early and often. See the help text for more detailed
usage instructions.
```sh
$ dep help ensure
```
### Installing dependencies
(if your `vendor/` directory isn't [checked in with your code](docs/FAQ.md#should-i-commit-my-vendor-directory))
```sh
$ dep ensure
```
If a dependency already exists in your `vendor/` folder, dep will ensure it
matches the constraints from the manifest. If the dependency is missing from
`vendor/`, the latest version allowed by your manifest will be installed.
### Adding a dependency
```sh
$ dep ensure -add github.com/foo/bar
```
This adds a version constraint to your `Gopkg.toml`, and updates `Gopkg.lock` and `vendor/`. Now, import and use the package in your code! ✨
`dep ensure -add` has some subtle behavior variations depending on the project or package named, and the state of your tree. See `dep ensure -examples` for more information.
### Changing dependencies
If you want to:
* Change the allowed `version`/`branch`/`revision`
* Switch to using a fork
for one or more dependencies, do the following:
1. Manually edit your `Gopkg.toml`.
1. Run
```sh
$ dep ensure
```
### Checking the status of dependencies
Run `dep status` to see the current status of all your dependencies.
```sh
$ dep status
PROJECT CONSTRAINT VERSION REVISION LATEST
github.com/Masterminds/semver branch 2.x branch 2.x 139cc09 c2e7f6c
github.com/Masterminds/vcs ^1.11.0 v1.11.1 3084677 3084677
github.com/armon/go-radix * branch master 4239b77 4239b77
```
On top of that, if you have added new imports to your project or modified `Gopkg.toml` without running `dep ensure` again, `dep status` will tell you there is a mismatch between `Gopkg.lock` and the current status of the project.
```sh
$ dep status
Lock inputs-digest mismatch due to the following packages missing from the lock:
PROJECT MISSING PACKAGES
github.com/Masterminds/goutils [github.com/Masterminds/goutils]
This happens when a new import is added. Run `dep ensure` to install the missing packages.
```
As `dep status` suggests, run `dep ensure` to update your lockfile. Then run `dep status` again, and the lock mismatch should go away.
### Visualizing dependencies
Generate a visual representation of the dependency tree by piping the output of `dep status -dot` to [graphviz](http://www.graphviz.org/).
#### Linux
```
$ sudo apt-get install graphviz
$ dep status -dot | dot -T png | display
```
#### MacOS
```
$ brew install graphviz
$ dep status -dot | dot -T png | open -f -a /Applications/Preview.app
```
#### Windows
```
> choco install graphviz.portable
> dep status -dot | dot -T png -o status.png; start status.png
```

### Updating dependencies
Updating brings the version of a dependency in `Gopkg.lock` and `vendor/` to the latest version allowed by the constraints in `Gopkg.toml`.
You can update just a targeted subset of dependencies (recommended):
```sh
$ dep ensure -update github.com/some/project github.com/other/project
$ dep ensure -update github.com/another/project
```
Or you can update all your dependencies at once:
```sh
$ dep ensure -update
```
"Latest" means different things depending on the type of constraint in use. If you're depending on a `branch`, `dep` will update to the latest tip of that branch. If you're depending on a `version` using [a semver range](#semantic-versioning), it will update to the latest version in that range.
### Removing dependencies
1. Remove the `import`s and all usage from your code.
1. Remove `[[constraint]]` rules from `Gopkg.toml` (if any).
1. Run
```sh
$ dep ensure
```
### Testing changes to a dependency
Making changes in your `vendor/` directory directly is not recommended, as dep
will overwrite any changes. Instead:
1. Delete the dependency from the `vendor/` directory.
```sh
rm -rf vendor/
```
1. Add that dependency to your `GOPATH`, if it isn't already.
```sh
$ go get
```
1. Modify the dependency in `$GOPATH/src/`.
1. Test, build, etc.
Don't run `dep ensure` until you're done. `dep ensure` will reinstall the
dependency into `vendor/` based on your manifest, as if you were installing from
scratch.
This solution works for short-term use, but for something long-term, take a look
at [virtualgo](https://github.com/GetStream/vg).
To test out code that has been pushed as a new version, or to a branch or fork,
see [changing dependencies](#changing-dependencies).
## Semantic Versioning
`dep ensure` a uses an external [semver library](https://github.com/Masterminds/semver) to interpret the version constraints you specify in the manifest. The comparison operators are:
* `=`: equal
* `!=`: not equal
* `>`: greater than
* `<`: less than
* `>=`: greater than or equal to
* `<=`: less than or equal to
* `-`: literal range. Eg: 1.2 - 1.4.5 is equivalent to >= 1.2, <= 1.4.5
* `~`: minor range. Eg: ~1.2.3 is equivalent to >= 1.2.3, < 1.3.0
* `^`: major range. Eg: ^1.2.3 is equivalent to >= 1.2.3, < 2.0.0
* `[xX*]`: wildcard. Eg: 1.2.x is equivalent to >= 1.2.0, < 1.3.0
You might, for example, include a constraint in your manifest that specifies `version = "=2.0.0"` to pin a dependency to version 2.0.0, or constrain to minor releases with: `version = "2.*"`. Refer to the [semver library](https://github.com/Masterminds/semver) documentation for more info.
**Note**: When you specify a version *without an operator*, `dep` automatically uses the `^` operator by default. `dep ensure` will interpret the given version as the min-boundry of a range, for example:
* `1.2.3` becomes the range `>=1.2.3, <2.0.0`
* `0.2.3` becomes the range `>=0.2.3, <0.3.0`
* `0.0.3` becomes the range `>=0.0.3, <0.1.0`
## Feedback
Feedback is greatly appreciated.
At this stage, the maintainers are most interested in feedback centered on the user experience (UX) of the tool.
Do you have workflows that the tool supports well, or doesn't support at all?
Do any of the commands have surprising effects, output, or results?
Please check the existing issues and [FAQ](docs/FAQ.md) to see if your feedback has already been reported.
If not, please file an issue, describing what you did or wanted to do, what you expected to happen, and what actually happened.
## Contributing
Contributions are greatly appreciated.
The maintainers actively manage the issues list, and try to highlight issues suitable for newcomers.
The project follows the typical GitHub pull request model.
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.
Before starting any work, please either comment on an existing issue, or file a new one.
dep-0.3.2/analyzer.go 0000664 0000000 0000000 00000002442 13171666371 0014455 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package dep
import (
"os"
"path/filepath"
"github.com/golang/dep/internal/fs"
"github.com/golang/dep/internal/gps"
)
// Analyzer implements gps.ProjectAnalyzer.
type Analyzer struct{}
// HasDepMetadata determines if a dep manifest exists at the specified path.
func (a Analyzer) HasDepMetadata(path string) bool {
mf := filepath.Join(path, ManifestName)
fileOK, err := fs.IsRegular(mf)
return err == nil && fileOK
}
// DeriveManifestAndLock reads and returns the manifest at path/ManifestName or nil if one is not found.
// The Lock is always nil for now.
func (a Analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Manifest, gps.Lock, error) {
if !a.HasDepMetadata(path) {
return nil, nil, nil
}
f, err := os.Open(filepath.Join(path, ManifestName))
if err != nil {
return nil, nil, err
}
defer f.Close()
// Ignore warnings irrelevant to user.
m, _, err := readManifest(f)
if err != nil {
return nil, nil, err
}
return m, nil, nil
}
// Info returns Analyzer's name and version info.
func (a Analyzer) Info() gps.ProjectAnalyzerInfo {
return gps.ProjectAnalyzerInfo{
Name: "dep",
Version: 1,
}
}
dep-0.3.2/analyzer_notwindows_test.go 0000664 0000000 0000000 00000000654 13171666371 0020012 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !windows
package dep
import (
"io"
"os"
)
func makeUnreadable(path string) (io.Closer, error) {
err := os.Chmod(path, 0222)
if err != nil {
return nil, err
}
return closer{}, nil
}
type closer struct{}
func (closer) Close() error { return nil }
dep-0.3.2/analyzer_test.go 0000664 0000000 0000000 00000005340 13171666371 0015514 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package dep
import (
"path/filepath"
"testing"
"github.com/golang/dep/internal/test"
)
func TestAnalyzerDeriveManifestAndLock(t *testing.T) {
h := test.NewHelper(t)
defer h.Cleanup()
h.TempDir("dep")
golden := filepath.Join("analyzer", ManifestName)
want := h.GetTestFileString(golden)
h.TempCopy(filepath.Join("dep", ManifestName), golden)
a := Analyzer{}
m, l, err := a.DeriveManifestAndLock(h.Path("dep"), "my/fake/project")
if err != nil {
t.Fatal(err)
}
got, err := m.(*Manifest).MarshalTOML()
if err != nil {
t.Fatal(err)
}
if want != string(got) {
if *test.UpdateGolden {
if err := h.WriteTestFile(golden, string(got)); err != nil {
t.Fatal(err)
}
} else {
t.Fatalf("expected %s\n got %s", want, string(got))
}
}
if l != nil {
t.Fatalf("expected lock to be nil, got: %#v", l)
}
}
func TestAnalyzerDeriveManifestAndLockDoesNotExist(t *testing.T) {
h := test.NewHelper(t)
defer h.Cleanup()
h.TempDir("dep")
a := Analyzer{}
m, l, err := a.DeriveManifestAndLock(h.Path("dep"), "my/fake/project")
if m != nil || l != nil || err != nil {
t.Fatalf("expected manifest & lock & err to be nil: m -> %#v l -> %#v err-> %#v", m, l, err)
}
}
func TestAnalyzerDeriveManifestAndLockCannotOpen(t *testing.T) {
h := test.NewHelper(t)
defer h.Cleanup()
h.TempDir("dep")
// Simulate an inaccessible manifest file.
h.TempFile(filepath.Join("dep", ManifestName), "")
closer, err := makeUnreadable(filepath.Join(h.Path("dep"), ManifestName))
if err != nil {
t.Fatal(err)
}
defer closer.Close()
a := Analyzer{}
// Verify that the solver rejects the manifest, rather than treating it as
// offering no constraints.
m, l, err := a.DeriveManifestAndLock(h.Path("dep"), "my/fake/project")
if m != nil || l != nil || err == nil {
t.Fatalf("expected manifest & lock to be nil, err to be not nil: m -> %#v l -> %#v err -> %#v", m, l, err)
}
}
func TestAnalyzerDeriveManifestAndLockInvalidManifest(t *testing.T) {
h := test.NewHelper(t)
defer h.Cleanup()
h.TempDir("dep")
// Create a manifest with invalid contents
h.TempFile(filepath.Join("dep", ManifestName), "invalid manifest")
a := Analyzer{}
m, l, err := a.DeriveManifestAndLock(h.Path("dep"), "my/fake/project")
if m != nil || l != nil || err == nil {
t.Fatalf("expected manifest & lock & err to be nil: m -> %#v l -> %#v err-> %#v", m, l, err)
}
}
func TestAnalyzerInfo(t *testing.T) {
a := Analyzer{}
info := a.Info()
if info.Name != "dep" || info.Version != 1 {
t.Fatalf("expected name to be 'dep' and version to be 1: name -> %q vers -> %d", info.Name, info.Version)
}
}
dep-0.3.2/analyzer_windows_test.go 0000664 0000000 0000000 00000001723 13171666371 0017267 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package dep
import (
"io"
"os"
"syscall"
)
// makeUnreadable opens the file at path in exclusive mode. A file opened in
// exclusive mode cannot be opened again until the exclusive mode file handle
// is closed.
func makeUnreadable(path string) (io.Closer, error) {
if len(path) == 0 {
return nil, syscall.ERROR_FILE_NOT_FOUND
}
pathp, err := syscall.UTF16PtrFromString(path)
if err != nil {
return nil, err
}
access := uint32(syscall.GENERIC_READ | syscall.GENERIC_WRITE)
sharemode := uint32(0) // no sharing == exclusive mode
sa := (*syscall.SecurityAttributes)(nil)
createmode := uint32(syscall.OPEN_EXISTING)
h, err := syscall.CreateFile(pathp, access, sharemode, sa, createmode, syscall.FILE_ATTRIBUTE_NORMAL, 0)
if err != nil {
return nil, err
}
return os.NewFile(uintptr(h), path), nil
}
dep-0.3.2/appveyor.yml 0000664 0000000 0000000 00000001455 13171666371 0014674 0 ustar 00root root 0000000 0000000 version: "{build}"
# Source Config
clone_folder: c:\gopath\src\github.com\golang\dep
# Build host
environment:
GOPATH: c:\gopath
DEPTESTBYPASS501: 1
GOVERSION: 1.8
init:
- git config --global core.autocrlf input
# Build
install:
# Install the specific Go version.
- rmdir c:\go /s /q
- appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.msi
- msiexec /i go%GOVERSION%.windows-amd64.msi /q
- choco install bzr
- set Path=c:\go\bin;c:\gopath\bin;C:\Program Files (x86)\Bazaar\;C:\Program Files\Mercurial\%Path%
- go version
- go env
build: false
deploy: false
test_script:
- go build github.com/golang/dep/cmd/dep
- for /f "" %%G in ('go list github.com/golang/dep/... ^| find /i /v "/vendor/"') do ( go test %%G & IF ERRORLEVEL == 1 EXIT 1)
dep-0.3.2/cmd/ 0000775 0000000 0000000 00000000000 13171666371 0013042 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/ 0000775 0000000 0000000 00000000000 13171666371 0013612 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/dep_test.go 0000664 0000000 0000000 00000002461 13171666371 0015753 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"testing"
"github.com/golang/dep/internal/test"
)
// The TestMain function creates a dep command for testing purposes and
// deletes it after the tests have been run.
// Most of this is taken from https://github.com/golang/go/blob/master/src/cmd/go/go_test.go and reused here.
func TestMain(m *testing.M) {
args := []string{"build", "-o", "testdep" + test.ExeSuffix}
out, err := exec.Command("go", args...).CombinedOutput()
if err != nil {
fmt.Fprintf(os.Stderr, "building testdep failed: %v\n%s", err, out)
os.Exit(2)
}
// Don't let these environment variables confuse the test.
os.Unsetenv("GOPATH")
os.Unsetenv("GIT_ALLOW_PROTOCOL")
if home, ccacheDir := os.Getenv("HOME"), os.Getenv("CCACHE_DIR"); home != "" && ccacheDir == "" {
// On some systems the default C compiler is ccache.
// Setting HOME to a non-existent directory will break
// those systems. Set CCACHE_DIR to cope. Issue 17668.
os.Setenv("CCACHE_DIR", filepath.Join(home, ".ccache"))
}
os.Setenv("HOME", "/test-dep-home-does-not-exist")
r := m.Run()
os.Remove("testdep" + test.ExeSuffix)
os.Exit(r)
}
dep-0.3.2/cmd/dep/ensure.go 0000664 0000000 0000000 00000072223 13171666371 0015450 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"bytes"
"flag"
"fmt"
"go/build"
"io/ioutil"
"log"
"os"
"path/filepath"
"sort"
"strings"
"sync"
"github.com/golang/dep"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/gps/paths"
"github.com/golang/dep/internal/gps/pkgtree"
"github.com/pkg/errors"
)
const ensureShortHelp = `Ensure a dependency is safely vendored in the project`
const ensureLongHelp = `
Project spec:
[:alt source URL][@]
Ensure gets a project into a complete, reproducible, and likely compilable state:
* All non-stdlib imports are fulfilled
* All rules in Gopkg.toml are respected
* Gopkg.lock records precise versions for all dependencies
* vendor/ is populated according to Gopkg.lock
Ensure has fast techniques to determine that some of these steps may be
unnecessary. If that determination is made, ensure may skip some steps. Flags
may be passed to bypass these checks; -vendor-only will allow an out-of-date
Gopkg.lock to populate vendor/, and -no-vendor will update Gopkg.lock (if
needed), but never touch vendor/.
The effect of passing project spec arguments varies slightly depending on the
combination of flags that are passed.
Examples:
dep ensure Populate vendor from existing Gopkg.toml and Gopkg.lock
dep ensure -add github.com/pkg/foo Introduce a named dependency at its newest version
dep ensure -add github.com/pkg/foo@^1.0.1 Introduce a named dependency with a particular constraint
For more detailed usage examples, see dep ensure -examples.
`
const ensureExamples = `
dep ensure
Solve the project's dependency graph, and place all dependencies in the
vendor folder. If a dependency is in the lock file, use the version
specified there. Otherwise, use the most recent version that can satisfy the
constraints in the manifest file.
dep ensure -vendor-only
Write vendor/ from an exising Gopkg.lock file, without first verifying that
the lock is in sync with imports and Gopkg.toml. (This may be useful for
e.g. strategically layering a Docker images)
dep ensure -add github.com/pkg/foo github.com/pkg/foo/bar
Introduce one or more dependencies, at their newest version, ensuring that
specific packages are present in Gopkg.lock and vendor/. Also, append a
corresponding constraint to Gopkg.toml.
Note: packages introduced in this way will disappear on the next "dep
ensure" if an import statement is not added first.
dep ensure -add github.com/pkg/foo/subpkg@1.0.0 bitbucket.org/pkg/bar/baz@master
Append version constraints to Gopkg.toml for one or more packages, if no
such rules already exist.
If the named packages are not already imported, also ensure they are present
in Gopkg.lock and vendor/. As in the preceding example, packages introduced
in this way will disappear on the next "dep ensure" if an import statement
is not added first.
dep ensure -add github.com/pkg/foo:git.internal.com/alt/foo
Specify an alternate location to treat as the upstream source for a dependency.
dep ensure -update github.com/pkg/foo github.com/pkg/bar
Update a list of dependencies to the latest versions allowed by Gopkg.toml,
ignoring any versions recorded in Gopkg.lock. Write the results to
Gopkg.lock and vendor/.
dep ensure -update
Update all dependencies to the latest versions allowed by Gopkg.toml,
ignoring any versions recorded in Gopkg.lock. Update the lock file with any
changes. (NOTE: Not recommended. Updating one/some dependencies at a time is
preferred.)
dep ensure -update -no-vendor
As above, but only modify Gopkg.lock; leave vendor/ unchanged.
dep ensure -no-vendor -dry-run
This fails with a non zero exit code if Gopkg.lock is not up to date with
the Gopkg.toml or the project imports. It can be useful to run this during
CI to check if Gopkg.lock is up to date.
`
var (
errUpdateArgsValidation = errors.New("update arguments validation failed")
errAddDepsFailed = errors.New("adding dependencies failed")
)
func (cmd *ensureCommand) Name() string { return "ensure" }
func (cmd *ensureCommand) Args() string {
return "[-update | -add] [-no-vendor | -vendor-only] [-dry-run] [...]"
}
func (cmd *ensureCommand) ShortHelp() string { return ensureShortHelp }
func (cmd *ensureCommand) LongHelp() string { return ensureLongHelp }
func (cmd *ensureCommand) Hidden() bool { return false }
func (cmd *ensureCommand) Register(fs *flag.FlagSet) {
fs.BoolVar(&cmd.examples, "examples", false, "print detailed usage examples")
fs.BoolVar(&cmd.update, "update", false, "update the named dependencies (or all, if none are named) in Gopkg.lock to the latest allowed by Gopkg.toml")
fs.BoolVar(&cmd.add, "add", false, "add new dependencies, or populate Gopkg.toml with constraints for existing dependencies")
fs.BoolVar(&cmd.vendorOnly, "vendor-only", false, "populate vendor/ from Gopkg.lock without updating it first")
fs.BoolVar(&cmd.noVendor, "no-vendor", false, "update Gopkg.lock (if needed), but do not update vendor/")
fs.BoolVar(&cmd.dryRun, "dry-run", false, "only report the changes that would be made")
}
type ensureCommand struct {
examples bool
update bool
add bool
noVendor bool
vendorOnly bool
dryRun bool
}
func (cmd *ensureCommand) Run(ctx *dep.Ctx, args []string) error {
if cmd.examples {
ctx.Err.Println(strings.TrimSpace(ensureExamples))
return nil
}
if err := cmd.validateFlags(); err != nil {
return err
}
p, err := ctx.LoadProject()
if err != nil {
return err
}
sm, err := ctx.SourceManager()
if err != nil {
return err
}
sm.UseDefaultSignalHandling()
defer sm.Release()
if err := dep.ValidateProjectRoots(ctx, p.Manifest, sm); err != nil {
return err
}
params := p.MakeParams()
if ctx.Verbose {
params.TraceLogger = ctx.Err
}
if cmd.vendorOnly {
return cmd.runVendorOnly(ctx, args, p, sm, params)
}
params.RootPackageTree, err = p.ParseRootPackageTree()
if err != nil {
return err
}
if fatal, err := checkErrors(params.RootPackageTree.Packages, p.Manifest.IgnoredPackages()); err != nil {
if fatal {
return err
} else if ctx.Verbose {
ctx.Out.Println(err)
}
}
if cmd.add {
return cmd.runAdd(ctx, args, p, sm, params)
} else if cmd.update {
return cmd.runUpdate(ctx, args, p, sm, params)
}
return cmd.runDefault(ctx, args, p, sm, params)
}
func (cmd *ensureCommand) validateFlags() error {
if cmd.add && cmd.update {
return errors.New("cannot pass both -add and -update")
}
if cmd.vendorOnly {
if cmd.update {
return errors.New("-vendor-only makes -update a no-op; cannot pass them together")
}
if cmd.add {
return errors.New("-vendor-only makes -add a no-op; cannot pass them together")
}
if cmd.noVendor {
// TODO(sdboyer) can't think of anything not snarky right now
return errors.New("really?")
}
}
return nil
}
func (cmd *ensureCommand) runDefault(ctx *dep.Ctx, args []string, p *dep.Project, sm gps.SourceManager, params gps.SolveParameters) error {
// Bare ensure doesn't take any args.
if len(args) != 0 {
return errors.New("dep ensure only takes spec arguments with -add or -update")
}
if err := ctx.ValidateParams(sm, params); err != nil {
return err
}
solver, err := gps.Prepare(params, sm)
if err != nil {
return errors.Wrap(err, "prepare solver")
}
if p.Lock != nil && bytes.Equal(p.Lock.InputsDigest(), solver.HashInputs()) {
// Memo matches, so there's probably nothing to do.
if ctx.Verbose {
ctx.Out.Printf("%s was already in sync with imports and %s\n", dep.LockName, dep.ManifestName)
}
if cmd.noVendor {
// The user said not to touch vendor/, so definitely nothing to do.
return nil
}
// TODO(sdboyer) The desired behavior at this point is to determine
// whether it's necessary to write out vendor, or if it's already
// consistent with the lock. However, we haven't yet determined what
// that "verification" is supposed to look like (#121); in the meantime,
// we unconditionally write out vendor/ so that `dep ensure`'s behavior
// is maximally compatible with what it will eventually become.
sw, err := dep.NewSafeWriter(nil, p.Lock, p.Lock, dep.VendorAlways)
if err != nil {
return err
}
if cmd.dryRun {
return sw.PrintPreparedActions(ctx.Out, ctx.Verbose)
}
logger := ctx.Err
if !ctx.Verbose {
logger = log.New(ioutil.Discard, "", 0)
}
return errors.WithMessage(sw.Write(p.AbsRoot, sm, true, logger), "grouped write of manifest, lock and vendor")
}
if cmd.noVendor && cmd.dryRun {
return errors.New("Gopkg.lock was not up to date")
}
solution, err := solver.Solve()
if err != nil {
handleAllTheFailuresOfTheWorld(err)
return errors.Wrap(err, "ensure Solve()")
}
vendorBehavior := dep.VendorOnChanged
if cmd.noVendor {
vendorBehavior = dep.VendorNever
}
sw, err := dep.NewSafeWriter(nil, p.Lock, dep.LockFromSolution(solution), vendorBehavior)
if err != nil {
return err
}
if cmd.dryRun {
return sw.PrintPreparedActions(ctx.Out, ctx.Verbose)
}
logger := ctx.Err
if !ctx.Verbose {
logger = log.New(ioutil.Discard, "", 0)
}
return errors.Wrap(sw.Write(p.AbsRoot, sm, false, logger), "grouped write of manifest, lock and vendor")
}
func (cmd *ensureCommand) runVendorOnly(ctx *dep.Ctx, args []string, p *dep.Project, sm gps.SourceManager, params gps.SolveParameters) error {
if len(args) != 0 {
return errors.Errorf("dep ensure -vendor-only only populates vendor/ from %s; it takes no spec arguments", dep.LockName)
}
if p.Lock == nil {
return errors.Errorf("no %s exists from which to populate vendor/", dep.LockName)
}
// Pass the same lock as old and new so that the writer will observe no
// difference and choose not to write it out.
sw, err := dep.NewSafeWriter(nil, p.Lock, p.Lock, dep.VendorAlways)
if err != nil {
return err
}
if cmd.dryRun {
return sw.PrintPreparedActions(ctx.Out, ctx.Verbose)
}
logger := ctx.Err
if !ctx.Verbose {
logger = log.New(ioutil.Discard, "", 0)
}
return errors.WithMessage(sw.Write(p.AbsRoot, sm, true, logger), "grouped write of manifest, lock and vendor")
}
func (cmd *ensureCommand) runUpdate(ctx *dep.Ctx, args []string, p *dep.Project, sm gps.SourceManager, params gps.SolveParameters) error {
if p.Lock == nil {
return errors.Errorf("-update works by updating the versions recorded in %s, but %s does not exist", dep.LockName, dep.LockName)
}
if err := ctx.ValidateParams(sm, params); err != nil {
return err
}
// We'll need to discard this prepared solver as later work changes params,
// but solver preparation is cheap and worth doing up front in order to
// perform the fastpath check of hash comparison.
solver, err := gps.Prepare(params, sm)
if err != nil {
return errors.Wrap(err, "fastpath solver prepare")
}
// Compare the hashes. If they're not equal, bail out and ask the user to
// run a straight `dep ensure` before updating. This is handholding the
// user a bit, but the extra effort required is minimal, and it ensures the
// user is isolating variables in the event of solve problems (was it the
// "pending" changes, or the -update that caused the problem?).
if !bytes.Equal(p.Lock.InputsDigest(), solver.HashInputs()) {
ctx.Out.Printf("Warning: %s is out of sync with %s or the project's imports.", dep.LockName, dep.ManifestName)
}
// When -update is specified without args, allow every dependency to change
// versions, regardless of the lock file.
if len(args) == 0 {
params.ChangeAll = true
}
if err := validateUpdateArgs(ctx, args, p, sm, ¶ms); err != nil {
return err
}
// Re-prepare a solver now that our params are complete.
solver, err = gps.Prepare(params, sm)
if err != nil {
return errors.Wrap(err, "fastpath solver prepare")
}
solution, err := solver.Solve()
if err != nil {
// TODO(sdboyer) special handling for warning cases as described in spec
// - e.g., named projects did not upgrade even though newer versions
// were available.
handleAllTheFailuresOfTheWorld(err)
return errors.Wrap(err, "ensure Solve()")
}
sw, err := dep.NewSafeWriter(nil, p.Lock, dep.LockFromSolution(solution), dep.VendorOnChanged)
if err != nil {
return err
}
if cmd.dryRun {
return sw.PrintPreparedActions(ctx.Out, ctx.Verbose)
}
logger := ctx.Err
if !ctx.Verbose {
logger = log.New(ioutil.Discard, "", 0)
}
return errors.Wrap(sw.Write(p.AbsRoot, sm, false, logger), "grouped write of manifest, lock and vendor")
}
func (cmd *ensureCommand) runAdd(ctx *dep.Ctx, args []string, p *dep.Project, sm gps.SourceManager, params gps.SolveParameters) error {
if len(args) == 0 {
return errors.New("must specify at least one project or package to -add")
}
if err := ctx.ValidateParams(sm, params); err != nil {
return err
}
// We'll need to discard this prepared solver as later work changes params,
// but solver preparation is cheap and worth doing up front in order to
// perform the fastpath check of hash comparison.
solver, err := gps.Prepare(params, sm)
if err != nil {
return errors.Wrap(err, "fastpath solver prepare")
}
// Compare the hashes. If they're not equal, bail out and ask the user to
// run a straight `dep ensure` before updating. This is handholding the
// user a bit, but the extra effort required is minimal, and it ensures the
// user is isolating variables in the event of solve problems (was it the
// "pending" changes, or the -add that caused the problem?).
if p.Lock != nil && !bytes.Equal(p.Lock.InputsDigest(), solver.HashInputs()) {
ctx.Out.Printf("Warning: %s is out of sync with %s or the project's imports.", dep.LockName, dep.ManifestName)
}
rm, _ := params.RootPackageTree.ToReachMap(true, true, false, p.Manifest.IgnoredPackages())
// TODO(sdboyer) re-enable this once we ToReachMap() intelligently filters out normally-excluded (_*, .*), dirs from errmap
//rm, errmap := params.RootPackageTree.ToReachMap(true, true, false, p.Manifest.IgnoredPackages())
// Having some problematic internal packages isn't cause for termination,
// but the user needs to be warned.
//for fail, err := range errmap {
//if _, is := err.Err.(*build.NoGoError); !is {
//ctx.Err.Printf("Warning: %s, %s", fail, err)
//}
//}
// Compile unique sets of 1) all external packages imported or required, and
// 2) the project roots under which they fall.
exmap := make(map[string]bool)
exrmap := make(map[gps.ProjectRoot]bool)
for _, ex := range append(rm.FlattenFn(paths.IsStandardImportPath), p.Manifest.Required...) {
exmap[ex] = true
root, err := sm.DeduceProjectRoot(ex)
if err != nil {
// This should be very uncommon to hit, as it entails that we
// couldn't deduce the root for an import, but that some previous
// solve run WAS able to deduce the root. It's most likely to occur
// if the user has e.g. not connected to their organization's VPN,
// and thus cannot access an internal go-get metadata service.
return errors.Wrapf(err, "could not deduce project root for %s", ex)
}
exrmap[root] = true
}
// Note: these flags are only partialy used by the latter parts of the
// algorithm; rather, it relies on inference. However, they remain in their
// entirety as future needs may make further use of them, being a handy,
// terse way of expressing the original context of the arg inputs.
type addType uint8
const (
// Straightforward case - this induces a temporary require, and thus
// a warning message about it being ephemeral.
isInManifest addType = 1 << iota
// If solving works, we'll pull this constraint from the in-memory
// manifest (where we recorded it earlier) and then append it to the
// manifest on disk.
isInImportsWithConstraint
// If solving works, we'll extract a constraint from the lock and
// append it into the manifest on disk, similar to init's behavior.
isInImportsNoConstraint
// This gets a message AND a hoist from the solution up into the
// manifest on disk.
isInNeither
)
type addInstruction struct {
id gps.ProjectIdentifier
ephReq map[string]bool
constraint gps.Constraint
typ addType
}
addInstructions := make(map[gps.ProjectRoot]addInstruction)
// A mutex for limited access to addInstructions by goroutines.
var mutex sync.Mutex
// Channel for receiving all the errors.
errCh := make(chan error, len(args))
var wg sync.WaitGroup
ctx.Out.Println("Fetching sources...")
for i, arg := range args {
wg.Add(1)
if ctx.Verbose {
ctx.Err.Printf("(%d/%d) %s\n", i+1, len(args), arg)
}
go func(arg string) {
defer wg.Done()
pc, path, err := getProjectConstraint(arg, sm)
if err != nil {
// TODO(sdboyer) ensure these errors are contextualized in a sensible way for -add
errCh <- err
return
}
// check if the the parsed path is the current root path
if strings.EqualFold(string(p.ImportRoot), string(pc.Ident.ProjectRoot)) {
errCh <- errors.New("cannot add current project to itself")
return
}
inManifest := p.Manifest.HasConstraintsOn(pc.Ident.ProjectRoot)
inImports := exrmap[pc.Ident.ProjectRoot]
if inManifest && inImports {
errCh <- errors.Errorf("nothing to -add, %s is already in %s and the project's direct imports or required list", pc.Ident.ProjectRoot, dep.ManifestName)
return
}
err = sm.SyncSourceFor(pc.Ident)
if err != nil {
errCh <- errors.Wrapf(err, "failed to fetch source for %s", pc.Ident.ProjectRoot)
return
}
someConstraint := !gps.IsAny(pc.Constraint) || pc.Ident.Source != ""
// Obtain a lock for addInstructions
mutex.Lock()
defer mutex.Unlock()
instr, has := addInstructions[pc.Ident.ProjectRoot]
if has {
// Multiple packages from the same project were specified as
// arguments; make sure they agree on declared constraints.
// TODO(sdboyer) until we have a general method for checking constraint equality, only allow one to declare
if someConstraint {
if !gps.IsAny(instr.constraint) || instr.id.Source != "" {
errCh <- errors.Errorf("can only specify rules once per project being added; rules were given at least twice for %s", pc.Ident.ProjectRoot)
return
}
instr.constraint = pc.Constraint
instr.id = pc.Ident
}
} else {
instr.ephReq = make(map[string]bool)
instr.constraint = pc.Constraint
instr.id = pc.Ident
}
if inManifest {
if someConstraint {
errCh <- errors.Errorf("%s already contains rules for %s, cannot specify a version constraint or alternate source", dep.ManifestName, path)
return
}
instr.ephReq[path] = true
instr.typ |= isInManifest
} else if inImports {
if !someConstraint {
if exmap[path] {
errCh <- errors.Errorf("%s is already imported or required, so -add is only valid with a constraint", path)
return
}
// No constraints, but the package isn't imported; require it.
// TODO(sdboyer) this case seems like it's getting overly specific and risks muddying the water more than it helps
instr.ephReq[path] = true
instr.typ |= isInImportsNoConstraint
} else {
// Don't require on this branch if the path was a ProjectRoot;
// most common here will be the user adding constraints to
// something they already imported, and if they specify the
// root, there's a good chance they don't actually want to
// require the project's root package, but are just trying to
// indicate which project should receive the constraints.
if !exmap[path] && string(pc.Ident.ProjectRoot) != path {
instr.ephReq[path] = true
}
instr.typ |= isInImportsWithConstraint
}
} else {
instr.typ |= isInNeither
instr.ephReq[path] = true
}
addInstructions[pc.Ident.ProjectRoot] = instr
}(arg)
}
wg.Wait()
close(errCh)
// Newline after printing the fetching source output.
ctx.Err.Println()
// Log all the errors.
if len(errCh) > 0 {
ctx.Err.Printf("Failed to add the dependencies:\n\n")
for err := range errCh {
ctx.Err.Println(" ✗", err.Error())
}
ctx.Err.Println()
return errAddDepsFailed
}
// We're now sure all of our add instructions are individually and mutually
// valid, so it's safe to begin modifying the input parameters.
for pr, instr := range addInstructions {
// The arg processing logic above only adds to the ephReq list if
// that package definitely needs to be on that list, so we don't
// need to check instr.typ here - if it's in instr.ephReq, it
// definitely needs to be added to the manifest's required list.
for path := range instr.ephReq {
p.Manifest.Required = append(p.Manifest.Required, path)
}
// Only two branches can possibly be adding rules, though the
// isInNeither case may or may not have an empty constraint.
if instr.typ&(isInNeither|isInImportsWithConstraint) != 0 {
p.Manifest.Constraints[pr] = gps.ProjectProperties{
Source: instr.id.Source,
Constraint: instr.constraint,
}
}
}
// Re-prepare a solver now that our params are complete.
solver, err = gps.Prepare(params, sm)
if err != nil {
return errors.Wrap(err, "fastpath solver prepare")
}
solution, err := solver.Solve()
if err != nil {
// TODO(sdboyer) detect if the failure was specifically about some of the -add arguments
handleAllTheFailuresOfTheWorld(err)
return errors.Wrap(err, "ensure Solve()")
}
// Prep post-actions and feedback from adds.
var reqlist []string
appender := dep.NewManifest()
for pr, instr := range addInstructions {
for path := range instr.ephReq {
reqlist = append(reqlist, path)
}
if instr.typ&isInManifest == 0 {
var pp gps.ProjectProperties
var found bool
for _, proj := range solution.Projects() {
// We compare just ProjectRoot instead of the whole
// ProjectIdentifier here because an empty source on the input side
// could have been converted into a source by the solver.
if proj.Ident().ProjectRoot == pr {
found = true
pp = getProjectPropertiesFromVersion(proj.Version())
break
}
}
if !found {
panic(fmt.Sprintf("unreachable: solution did not contain -add argument %s, but solver did not fail", pr))
}
pp.Source = instr.id.Source
if !gps.IsAny(instr.constraint) {
pp.Constraint = instr.constraint
}
appender.Constraints[pr] = pp
}
}
extra, err := appender.MarshalTOML()
if err != nil {
return errors.Wrap(err, "could not marshal manifest into TOML")
}
sort.Strings(reqlist)
sw, err := dep.NewSafeWriter(nil, p.Lock, dep.LockFromSolution(solution), dep.VendorOnChanged)
if err != nil {
return err
}
if cmd.dryRun {
return sw.PrintPreparedActions(ctx.Out, ctx.Verbose)
}
logger := ctx.Err
if !ctx.Verbose {
logger = log.New(ioutil.Discard, "", 0)
}
if err := errors.Wrap(sw.Write(p.AbsRoot, sm, true, logger), "grouped write of manifest, lock and vendor"); err != nil {
return err
}
// FIXME(sdboyer) manifest writes ABSOLUTELY need verification - follow up!
f, err := os.OpenFile(filepath.Join(p.AbsRoot, dep.ManifestName), os.O_APPEND|os.O_WRONLY, 0666)
if err != nil {
return errors.Wrapf(err, "opening %s failed", dep.ManifestName)
}
if _, err := f.Write(extra); err != nil {
f.Close()
return errors.Wrapf(err, "writing to %s failed", dep.ManifestName)
}
switch len(reqlist) {
case 0:
// nothing to tell the user
case 1:
if cmd.noVendor {
ctx.Out.Printf("%q is not imported by your project, and has been temporarily added to %s.\n", reqlist[0], dep.LockName)
ctx.Out.Printf("If you run \"dep ensure\" again before actually importing it, it will disappear from %s. Running \"dep ensure -vendor-only\" is safe, and will guarantee it is present in vendor/.", dep.LockName)
} else {
ctx.Out.Printf("%q is not imported by your project, and has been temporarily added to %s and vendor/.\n", reqlist[0], dep.LockName)
ctx.Out.Printf("If you run \"dep ensure\" again before actually importing it, it will disappear from %s and vendor/.", dep.LockName)
}
default:
if cmd.noVendor {
ctx.Out.Printf("The following packages are not imported by your project, and have been temporarily added to %s:\n", dep.LockName)
ctx.Out.Printf("\t%s\n", strings.Join(reqlist, "\n\t"))
ctx.Out.Printf("If you run \"dep ensure\" again before actually importing them, they will disappear from %s. Running \"dep ensure -vendor-only\" is safe, and will guarantee they are present in vendor/.", dep.LockName)
} else {
ctx.Out.Printf("The following packages are not imported by your project, and have been temporarily added to %s and vendor/:\n", dep.LockName)
ctx.Out.Printf("\t%s\n", strings.Join(reqlist, "\n\t"))
ctx.Out.Printf("If you run \"dep ensure\" again before actually importing them, they will disappear from %s and vendor/.", dep.LockName)
}
}
return errors.Wrapf(f.Close(), "closing %s", dep.ManifestName)
}
func getProjectConstraint(arg string, sm gps.SourceManager) (gps.ProjectConstraint, string, error) {
emptyPC := gps.ProjectConstraint{
Constraint: gps.Any(), // default to any; avoids panics later
}
// try to split on '@'
// When there is no `@`, use any version
var versionStr string
atIndex := strings.Index(arg, "@")
if atIndex > 0 {
parts := strings.SplitN(arg, "@", 2)
arg = parts[0]
versionStr = parts[1]
}
// TODO: if we decide to keep equals.....
// split on colon if there is a network location
var source string
colonIndex := strings.Index(arg, ":")
if colonIndex > 0 {
parts := strings.SplitN(arg, ":", 2)
arg = parts[0]
source = parts[1]
}
pr, err := sm.DeduceProjectRoot(arg)
if err != nil {
return emptyPC, "", errors.Wrapf(err, "could not infer project root from dependency path: %s", arg) // this should go through to the user
}
pi := gps.ProjectIdentifier{ProjectRoot: pr, Source: source}
c, err := sm.InferConstraint(versionStr, pi)
if err != nil {
return emptyPC, "", err
}
return gps.ProjectConstraint{Ident: pi, Constraint: c}, arg, nil
}
func checkErrors(m map[string]pkgtree.PackageOrErr, ignore *pkgtree.IgnoredRuleset) (fatal bool, err error) {
var (
noGoErrors int
pkgtreeErrors = make(pkgtreeErrs, 0, len(m))
)
for ip, poe := range m {
if ignore.IsIgnored(ip) {
continue
}
if poe.Err != nil {
switch poe.Err.(type) {
case *build.NoGoError:
noGoErrors++
default:
pkgtreeErrors = append(pkgtreeErrors, poe.Err)
}
}
}
// If pkgtree was empty or all dirs lacked any Go code, return an error.
if len(m) == 0 || len(m) == noGoErrors {
return true, errors.New("no dirs contained any Go code")
}
// If all dirs contained build errors, return an error.
if len(m) == len(pkgtreeErrors) {
return true, errors.New("all dirs contained build errors")
}
// If all directories either had no Go files or caused a build error, return an error.
if len(m) == len(pkgtreeErrors)+noGoErrors {
return true, pkgtreeErrors
}
// If m contained some errors, return a warning with those errors.
if len(pkgtreeErrors) > 0 {
return false, pkgtreeErrors
}
return false, nil
}
type pkgtreeErrs []error
func (e pkgtreeErrs) Error() string {
errs := make([]string, 0, len(e))
for _, err := range e {
errs = append(errs, err.Error())
}
return fmt.Sprintf("found %d errors in the package tree:\n%s", len(e), strings.Join(errs, "\n"))
}
func validateUpdateArgs(ctx *dep.Ctx, args []string, p *dep.Project, sm gps.SourceManager, params *gps.SolveParameters) error {
// Channel for receiving all the valid arguments.
argsCh := make(chan string, len(args))
// Channel for receiving all the validation errors.
errCh := make(chan error, len(args))
var wg sync.WaitGroup
// Allow any of specified project versions to change, regardless of the lock
// file.
for _, arg := range args {
wg.Add(1)
go func(arg string) {
defer wg.Done()
// Ensure the provided path has a deducible project root.
pc, path, err := getProjectConstraint(arg, sm)
if err != nil {
// TODO(sdboyer) ensure these errors are contextualized in a sensible way for -update
errCh <- err
return
}
if path != string(pc.Ident.ProjectRoot) {
// TODO(sdboyer): does this really merit an abortive error?
errCh <- errors.Errorf("%s is not a project root, try %s instead", path, pc.Ident.ProjectRoot)
return
}
if !p.Lock.HasProjectWithRoot(pc.Ident.ProjectRoot) {
errCh <- errors.Errorf("%s is not present in %s, cannot -update it", pc.Ident.ProjectRoot, dep.LockName)
return
}
if pc.Ident.Source != "" {
errCh <- errors.Errorf("cannot specify alternate sources on -update (%s)", pc.Ident.Source)
return
}
if !gps.IsAny(pc.Constraint) {
// TODO(sdboyer) constraints should be allowed to allow solves that
// target particular versions while remaining within declared constraints.
errCh <- errors.Errorf("version constraint %s passed for %s, but -update follows constraints declared in %s, not CLI arguments", pc.Constraint, pc.Ident.ProjectRoot, dep.ManifestName)
return
}
// Valid argument.
argsCh <- arg
}(arg)
}
wg.Wait()
close(errCh)
close(argsCh)
// Log all the errors.
if len(errCh) > 0 {
ctx.Err.Printf("Invalid arguments passed to ensure -update:\n\n")
for err := range errCh {
ctx.Err.Println(" ✗", err.Error())
}
ctx.Err.Println()
return errUpdateArgsValidation
}
// Add all the valid arguments to solve params.
for arg := range argsCh {
params.ToChange = append(params.ToChange, gps.ProjectRoot(arg))
}
return nil
}
dep-0.3.2/cmd/dep/ensure_test.go 0000664 0000000 0000000 00000014150 13171666371 0016502 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"bytes"
"errors"
"go/build"
"io/ioutil"
"log"
"strings"
"testing"
"github.com/golang/dep"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/gps/pkgtree"
"github.com/golang/dep/internal/test"
)
func TestInvalidEnsureFlagCombinations(t *testing.T) {
ec := &ensureCommand{
update: true,
add: true,
}
if err := ec.validateFlags(); err == nil {
t.Error("-add and -update together should fail validation")
}
ec.vendorOnly, ec.add = true, false
if err := ec.validateFlags(); err == nil {
t.Error("-vendor-only with -update should fail validation")
}
ec.add, ec.update = true, false
if err := ec.validateFlags(); err == nil {
t.Error("-vendor-only with -add should fail validation")
}
ec.noVendor, ec.add = true, false
if err := ec.validateFlags(); err == nil {
t.Error("-vendor-only with -no-vendor should fail validation")
}
ec.noVendor = false
// Also verify that the plain ensure path takes no args. This is a shady
// test, as lots of other things COULD return errors, and we don't check
// anything other than the error being non-nil. For now, it works well
// because a panic will quickly result if the initial arg length validation
// checks are incorrectly handled.
if err := ec.runDefault(nil, []string{"foo"}, nil, nil, gps.SolveParameters{}); err == nil {
t.Errorf("no args to plain ensure with -vendor-only")
}
ec.vendorOnly = false
if err := ec.runDefault(nil, []string{"foo"}, nil, nil, gps.SolveParameters{}); err == nil {
t.Errorf("no args to plain ensure")
}
}
func TestCheckErrors(t *testing.T) {
tt := []struct {
name string
fatal bool
pkgOrErrMap map[string]pkgtree.PackageOrErr
}{
{
name: "noErrors",
fatal: false,
pkgOrErrMap: map[string]pkgtree.PackageOrErr{
"mypkg": {
P: pkgtree.Package{},
},
},
},
{
name: "hasErrors",
fatal: true,
pkgOrErrMap: map[string]pkgtree.PackageOrErr{
"github.com/me/pkg": {
Err: &build.NoGoError{},
},
"github.com/someone/pkg": {
Err: errors.New("code is busted"),
},
},
},
{
name: "onlyGoErrors",
fatal: false,
pkgOrErrMap: map[string]pkgtree.PackageOrErr{
"github.com/me/pkg": {
Err: &build.NoGoError{},
},
"github.com/someone/pkg": {
P: pkgtree.Package{},
},
},
},
{
name: "onlyBuildErrors",
fatal: false,
pkgOrErrMap: map[string]pkgtree.PackageOrErr{
"github.com/me/pkg": {
Err: &build.NoGoError{},
},
"github.com/someone/pkg": {
P: pkgtree.Package{},
},
},
},
{
name: "allGoErrors",
fatal: true,
pkgOrErrMap: map[string]pkgtree.PackageOrErr{
"github.com/me/pkg": {
Err: &build.NoGoError{},
},
},
},
{
name: "allMixedErrors",
fatal: true,
pkgOrErrMap: map[string]pkgtree.PackageOrErr{
"github.com/me/pkg": {
Err: &build.NoGoError{},
},
"github.com/someone/pkg": {
Err: errors.New("code is busted"),
},
},
},
}
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
fatal, err := checkErrors(tc.pkgOrErrMap, nil)
if tc.fatal != fatal {
t.Fatalf("expected fatal flag to be %T, got %T", tc.fatal, fatal)
}
if err == nil && fatal {
t.Fatal("unexpected fatal flag value while err is nil")
}
})
}
}
func TestValidateUpdateArgs(t *testing.T) {
cases := []struct {
name string
args []string
wantError error
wantWarn []string
lockedProjects []string
}{
{
name: "empty args",
args: []string{},
wantError: nil,
},
{
name: "not project root",
args: []string{"github.com/golang/dep/cmd"},
wantError: errUpdateArgsValidation,
wantWarn: []string{
"github.com/golang/dep/cmd is not a project root, try github.com/golang/dep instead",
},
},
{
name: "not present in lock",
args: []string{"github.com/golang/dep"},
wantError: errUpdateArgsValidation,
wantWarn: []string{
"github.com/golang/dep is not present in Gopkg.lock, cannot -update it",
},
},
{
name: "cannot specify alternate sources",
args: []string{"github.com/golang/dep:github.com/example/dep"},
wantError: errUpdateArgsValidation,
wantWarn: []string{
"cannot specify alternate sources on -update (github.com/example/dep)",
},
lockedProjects: []string{"github.com/golang/dep"},
},
{
name: "version constraint passed",
args: []string{"github.com/golang/dep@master"},
wantError: errUpdateArgsValidation,
wantWarn: []string{
"version constraint master passed for github.com/golang/dep, but -update follows constraints declared in Gopkg.toml, not CLI arguments",
},
lockedProjects: []string{"github.com/golang/dep"},
},
}
h := test.NewHelper(t)
defer h.Cleanup()
h.TempDir("src")
pwd := h.Path(".")
stderrOutput := &bytes.Buffer{}
errLogger := log.New(stderrOutput, "", 0)
ctx := &dep.Ctx{
GOPATH: pwd,
Out: log.New(ioutil.Discard, "", 0),
Err: errLogger,
}
sm, err := ctx.SourceManager()
h.Must(err)
defer sm.Release()
p := new(dep.Project)
params := p.MakeParams()
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
// Empty the buffer for every case
stderrOutput.Reset()
// Fill up the locked projects
lockedProjects := []gps.LockedProject{}
for _, lp := range c.lockedProjects {
pi := gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(lp)}
lockedProjects = append(lockedProjects, gps.NewLockedProject(pi, gps.NewVersion("v1.0.0"), []string{}))
}
// Add lock to project
p.Lock = &dep.Lock{P: lockedProjects}
err := validateUpdateArgs(ctx, c.args, p, sm, ¶ms)
if err != c.wantError {
t.Fatalf("Unexpected error while validating update args:\n\t(GOT): %v\n\t(WNT): %v", err, c.wantError)
}
warnings := stderrOutput.String()
for _, warn := range c.wantWarn {
if !strings.Contains(warnings, warn) {
t.Fatalf("Expected validateUpdateArgs errors to contain: %q", warn)
}
}
})
}
}
dep-0.3.2/cmd/dep/gopath_scanner.go 0000664 0000000 0000000 00000024620 13171666371 0017140 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"os"
"path/filepath"
"strings"
"sync"
"github.com/golang/dep"
fb "github.com/golang/dep/internal/feedback"
"github.com/golang/dep/internal/fs"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/gps/paths"
"github.com/golang/dep/internal/gps/pkgtree"
"github.com/pkg/errors"
)
// gopathScanner supplies manifest/lock data by scanning the contents of GOPATH
// It uses its results to fill-in any missing details left by the rootAnalyzer.
type gopathScanner struct {
ctx *dep.Ctx
directDeps map[string]bool
sm gps.SourceManager
pd projectData
origM *dep.Manifest
origL *dep.Lock
}
func newGopathScanner(ctx *dep.Ctx, directDeps map[string]bool, sm gps.SourceManager) *gopathScanner {
return &gopathScanner{
ctx: ctx,
directDeps: directDeps,
sm: sm,
}
}
// InitializeRootManifestAndLock performs analysis of the filesystem tree rooted
// at path, with the root import path importRoot, to determine the project's
// constraints. Respect any initial constraints defined in the root manifest and
// lock.
func (g *gopathScanner) InitializeRootManifestAndLock(rootM *dep.Manifest, rootL *dep.Lock) error {
var err error
g.ctx.Err.Println("Searching GOPATH for projects...")
g.pd, err = g.scanGopathForDependencies()
if err != nil {
return err
}
g.origM = dep.NewManifest()
g.origM.Constraints = g.pd.constraints
g.origL = &dep.Lock{
P: make([]gps.LockedProject, 0, len(g.pd.ondisk)),
}
for pr, v := range g.pd.ondisk {
// That we have to chop off these path prefixes is a symptom of
// a problem in gps itself
pkgs := make([]string, 0, len(g.pd.dependencies[pr]))
prslash := string(pr) + "/"
for _, pkg := range g.pd.dependencies[pr] {
if pkg == string(pr) {
pkgs = append(pkgs, ".")
} else {
pkgs = append(pkgs, trimPathPrefix(pkg, prslash))
}
}
g.origL.P = append(g.origL.P, gps.NewLockedProject(
gps.ProjectIdentifier{ProjectRoot: pr}, v, pkgs),
)
}
g.overlay(rootM, rootL)
return nil
}
// Fill in gaps in the root manifest/lock with data found from the GOPATH.
func (g *gopathScanner) overlay(rootM *dep.Manifest, rootL *dep.Lock) {
for pkg, prj := range g.origM.Constraints {
if _, has := rootM.Constraints[pkg]; has {
continue
}
rootM.Constraints[pkg] = prj
v := g.pd.ondisk[pkg]
pi := gps.ProjectIdentifier{ProjectRoot: pkg, Source: prj.Source}
f := fb.NewConstraintFeedback(gps.ProjectConstraint{Ident: pi, Constraint: v}, fb.DepTypeDirect)
f.LogFeedback(g.ctx.Err)
f = fb.NewLockedProjectFeedback(gps.NewLockedProject(pi, v, nil), fb.DepTypeDirect)
f.LogFeedback(g.ctx.Err)
}
// Keep track of which projects have been locked
lockedProjects := map[gps.ProjectRoot]bool{}
for _, lp := range rootL.P {
lockedProjects[lp.Ident().ProjectRoot] = true
}
for _, lp := range g.origL.P {
pkg := lp.Ident().ProjectRoot
if _, isLocked := lockedProjects[pkg]; isLocked {
continue
}
rootL.P = append(rootL.P, lp)
lockedProjects[pkg] = true
if _, isDirect := g.directDeps[string(pkg)]; !isDirect {
f := fb.NewLockedProjectFeedback(lp, fb.DepTypeTransitive)
f.LogFeedback(g.ctx.Err)
}
}
// Identify projects whose version is unknown and will have to be solved for
var unlockedProjects []string
for pr := range g.pd.notondisk {
if _, isLocked := lockedProjects[pr]; isLocked {
continue
}
unlockedProjects = append(unlockedProjects, string(pr))
}
if len(unlockedProjects) > 0 {
g.ctx.Err.Printf("Following dependencies were not found in GOPATH. "+
"Dep will use the most recent versions of these projects.\n %s",
strings.Join(unlockedProjects, "\n "))
}
}
func trimPathPrefix(p1, p2 string) string {
if isPrefix, _ := fs.HasFilepathPrefix(p1, p2); isPrefix {
return p1[len(p2):]
}
return p1
}
// contains checks if a array of strings contains a value
func contains(a []string, b string) bool {
for _, v := range a {
if b == v {
return true
}
}
return false
}
// getProjectPropertiesFromVersion takes a Version and returns a proper
// ProjectProperties with Constraint value based on the provided version.
func getProjectPropertiesFromVersion(v gps.Version) gps.ProjectProperties {
pp := gps.ProjectProperties{}
// extract version and ignore if it's revision only
switch tv := v.(type) {
case gps.PairedVersion:
v = tv.Unpair()
case gps.Revision:
return pp
}
switch v.Type() {
case gps.IsBranch, gps.IsVersion:
pp.Constraint = v
case gps.IsSemver:
c, err := gps.NewSemverConstraintIC(v.String())
if err != nil {
panic(err)
}
pp.Constraint = c
}
return pp
}
type projectData struct {
constraints gps.ProjectConstraints // constraints that could be found
dependencies map[gps.ProjectRoot][]string // all dependencies (imports) found by project root
notondisk map[gps.ProjectRoot]bool // projects that were not found on disk
ondisk map[gps.ProjectRoot]gps.Version // projects that were found on disk
}
func (g *gopathScanner) scanGopathForDependencies() (projectData, error) {
constraints := make(gps.ProjectConstraints)
dependencies := make(map[gps.ProjectRoot][]string)
packages := make(map[string]bool)
notondisk := make(map[gps.ProjectRoot]bool)
ondisk := make(map[gps.ProjectRoot]gps.Version)
var syncDepGroup sync.WaitGroup
syncDep := func(pr gps.ProjectRoot, sm gps.SourceManager) {
if err := sm.SyncSourceFor(gps.ProjectIdentifier{ProjectRoot: pr}); err != nil {
g.ctx.Err.Printf("%+v", errors.Wrapf(err, "Unable to cache %s", pr))
}
syncDepGroup.Done()
}
if len(g.directDeps) == 0 {
return projectData{}, nil
}
for ip := range g.directDeps {
pr, err := g.sm.DeduceProjectRoot(ip)
if err != nil {
return projectData{}, errors.Wrap(err, "sm.DeduceProjectRoot")
}
packages[ip] = true
if _, has := dependencies[pr]; has {
dependencies[pr] = append(dependencies[pr], ip)
continue
}
syncDepGroup.Add(1)
go syncDep(pr, g.sm)
dependencies[pr] = []string{ip}
abs, err := g.ctx.AbsForImport(string(pr))
if err != nil {
notondisk[pr] = true
continue
}
v, err := gps.VCSVersion(abs)
if err != nil {
notondisk[pr] = true
continue
}
ondisk[pr] = v
pp := getProjectPropertiesFromVersion(v)
if pp.Constraint != nil || pp.Source != "" {
constraints[pr] = pp
}
}
// Explore the packages we've found for transitive deps, either
// completing the lock or identifying (more) missing projects that we'll
// need to ask gps to solve for us.
colors := make(map[string]uint8)
const (
white uint8 = iota
grey
black
)
// cache of PackageTrees, so we don't parse projects more than once
ptrees := make(map[gps.ProjectRoot]pkgtree.PackageTree)
// depth-first traverser
var dft func(string) error
dft = func(pkg string) error {
switch colors[pkg] {
case white:
colors[pkg] = grey
pr, err := g.sm.DeduceProjectRoot(pkg)
if err != nil {
return errors.Wrap(err, "could not deduce project root for "+pkg)
}
// We already visited this project root earlier via some other
// pkg within it, and made the decision that it's not on disk.
// Respect that decision, and pop the stack.
if notondisk[pr] {
colors[pkg] = black
return nil
}
ptree, has := ptrees[pr]
if !has {
// It's fine if the root does not exist - it indicates that this
// project is not present in the workspace, and so we need to
// solve to deal with this dep.
r := filepath.Join(g.ctx.GOPATH, "src", string(pr))
fi, err := os.Stat(r)
if os.IsNotExist(err) || !fi.IsDir() {
colors[pkg] = black
notondisk[pr] = true
return nil
}
// We know the project is on disk; the question is whether we're
// first seeing it here, in the transitive exploration, or if it
// was found in the initial pass on direct imports. We know it's
// the former if there's no entry for it in the ondisk map.
if _, in := ondisk[pr]; !in {
abs, err := g.ctx.AbsForImport(string(pr))
if err != nil {
colors[pkg] = black
notondisk[pr] = true
return nil
}
v, err := gps.VCSVersion(abs)
if err != nil {
// Even if we know it's on disk, errors are still
// possible when trying to deduce version. If we
// encounter such an error, just treat the project as
// not being on disk; the solver will work it out.
colors[pkg] = black
notondisk[pr] = true
return nil
}
ondisk[pr] = v
}
ptree, err = pkgtree.ListPackages(r, string(pr))
if err != nil {
// Any error here other than an a nonexistent dir (which
// can't happen because we covered that case above) is
// probably critical, so bail out.
return errors.Wrap(err, "gps.ListPackages")
}
ptrees[pr] = ptree
}
// Get a reachmap that includes main pkgs (even though importing
// them is an error, what we're checking right now is simply whether
// there's a package with go code present on disk), and does not
// backpropagate errors (again, because our only concern right now
// is package existence).
rm, errmap := ptree.ToReachMap(true, false, false, nil)
reached, ok := rm[pkg]
if !ok {
colors[pkg] = black
// not on disk...
notondisk[pr] = true
return nil
}
if _, ok := errmap[pkg]; ok {
// The package is on disk, but contains some errors.
colors[pkg] = black
return nil
}
if deps, has := dependencies[pr]; has {
if !contains(deps, pkg) {
dependencies[pr] = append(deps, pkg)
}
} else {
dependencies[pr] = []string{pkg}
syncDepGroup.Add(1)
go syncDep(pr, g.sm)
}
// recurse
for _, rpkg := range reached.External {
if paths.IsStandardImportPath(rpkg) {
continue
}
err := dft(rpkg)
if err != nil {
// Bubble up any errors we encounter
return err
}
}
colors[pkg] = black
case grey:
return errors.Errorf("Import cycle detected on %s", pkg)
}
return nil
}
// run the depth-first traversal from the set of immediate external
// package imports we found in the current project
for pkg := range packages {
err := dft(pkg)
if err != nil {
return projectData{}, err // already errors.Wrap()'d internally
}
}
syncDepGroup.Wait()
pd := projectData{
constraints: constraints,
dependencies: dependencies,
notondisk: notondisk,
ondisk: ondisk,
}
return pd, nil
}
dep-0.3.2/cmd/dep/gopath_scanner_test.go 0000664 0000000 0000000 00000011575 13171666371 0020204 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"io/ioutil"
"log"
"reflect"
"testing"
"github.com/golang/dep"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/test"
)
const testProject1 string = "github.com/sdboyer/deptest"
const testProject2 string = "github.com/sdboyer/deptestdos"
// NewTestContext creates a unique context with its own GOPATH for a single test.
func NewTestContext(h *test.Helper) *dep.Ctx {
h.TempDir("src")
pwd := h.Path(".")
discardLogger := log.New(ioutil.Discard, "", 0)
return &dep.Ctx{
GOPATH: pwd,
Out: discardLogger,
Err: discardLogger,
}
}
func TestGopathScanner_OverlayManifestConstraints(t *testing.T) {
h := test.NewHelper(t)
h.Parallel()
defer h.Cleanup()
ctx := NewTestContext(h)
pi1 := gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(testProject1)}
pi2 := gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(testProject2)}
v1 := gps.NewVersion("v1.0.0")
v2 := gps.NewVersion("v2.0.0")
v3 := gps.NewVersion("v3.0.0")
rootM := dep.NewManifest()
rootM.Constraints[pi1.ProjectRoot] = gps.ProjectProperties{Constraint: v1}
rootL := &dep.Lock{}
origM := dep.NewManifest()
origM.Constraints[pi1.ProjectRoot] = gps.ProjectProperties{Constraint: v2}
origM.Constraints[pi2.ProjectRoot] = gps.ProjectProperties{Constraint: v3}
gs := gopathScanner{
origM: origM,
origL: &dep.Lock{},
ctx: ctx,
pd: projectData{
ondisk: map[gps.ProjectRoot]gps.Version{
pi1.ProjectRoot: v2,
pi2.ProjectRoot: v3,
},
},
}
gs.overlay(rootM, rootL)
dep, has := rootM.Constraints[pi1.ProjectRoot]
if !has {
t.Fatalf("Expected the root manifest to contain %s", pi1.ProjectRoot)
}
wantC := v1.String()
gotC := dep.Constraint.String()
if wantC != gotC {
t.Fatalf("Expected %s to be constrained to '%s', got '%s'", pi1.ProjectRoot, wantC, gotC)
}
dep, has = rootM.Constraints[pi2.ProjectRoot]
if !has {
t.Fatalf("Expected the root manifest to contain %s", pi2.ProjectRoot)
}
wantC = v3.String()
gotC = dep.Constraint.String()
if wantC != gotC {
t.Fatalf("Expected %s to be constrained to '%s', got '%s'", pi2.ProjectRoot, wantC, gotC)
}
}
func TestGopathScanner_OverlayLockProjects(t *testing.T) {
h := test.NewHelper(t)
h.Parallel()
defer h.Cleanup()
ctx := NewTestContext(h)
rootM := dep.NewManifest()
pi1 := gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(testProject1)}
pi2 := gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(testProject2)}
v1 := gps.NewVersion("v1.0.0")
v2 := gps.NewVersion("v2.0.0")
v3 := gps.NewVersion("v3.0.0")
rootL := &dep.Lock{
P: []gps.LockedProject{gps.NewLockedProject(pi1, v1, []string{})},
}
gs := gopathScanner{
origM: dep.NewManifest(),
origL: &dep.Lock{
P: []gps.LockedProject{
gps.NewLockedProject(pi1, v2, []string{}), // ignored, already exists in lock
gps.NewLockedProject(pi2, v3, []string{}), // should be added to the lock
},
},
ctx: ctx,
pd: projectData{
ondisk: map[gps.ProjectRoot]gps.Version{
pi1.ProjectRoot: v2,
pi2.ProjectRoot: v3,
},
},
}
gs.overlay(rootM, rootL)
if len(rootL.P) != 2 {
t.Fatalf("Expected the root manifest to contain 2 packages, got %d", len(rootL.P))
}
if rootL.P[0].Version() != v1 {
t.Fatalf("Expected %s to be locked to '%s', got '%s'", rootL.P[0].Ident().ProjectRoot, v1, rootL.P[0].Version())
}
if rootL.P[1].Version() != v3 {
t.Fatalf("Expected %s to be locked to '%s', got '%s'", rootL.P[1].Ident().ProjectRoot, v3, rootL.P[1].Version())
}
}
func TestContains(t *testing.T) {
t.Parallel()
a := []string{"a", "b", "abcd"}
if !contains(a, "a") {
t.Fatal("expected array to contain 'a'")
}
if contains(a, "d") {
t.Fatal("expected array to not contain 'd'")
}
}
func TestGetProjectPropertiesFromVersion(t *testing.T) {
t.Parallel()
wantSemver, _ := gps.NewSemverConstraintIC("v1.0.0")
cases := []struct {
version, want gps.Constraint
}{
{
version: gps.NewBranch("foo-branch"),
want: gps.NewBranch("foo-branch"),
},
{
version: gps.NewVersion("foo-version"),
want: gps.NewVersion("foo-version"),
},
{
version: gps.NewVersion("v1.0.0"),
want: wantSemver,
},
{
version: gps.NewBranch("foo-branch").Pair("some-revision"),
want: gps.NewBranch("foo-branch"),
},
{
version: gps.NewVersion("foo-version").Pair("some-revision"),
want: gps.NewVersion("foo-version"),
},
{
version: gps.Revision("some-revision"),
want: nil,
},
{
version: gps.NewVersion("v1.0.0").Pair("some-revision"),
want: wantSemver,
},
}
for _, c := range cases {
actualProp := getProjectPropertiesFromVersion(c.version.(gps.Version))
if !reflect.DeepEqual(c.want, actualProp.Constraint) {
t.Fatalf("Constraints are not as expected: \n\t(GOT) %v\n\t(WNT) %v", actualProp.Constraint, c.want)
}
}
}
dep-0.3.2/cmd/dep/graphviz.go 0000664 0000000 0000000 00000004411 13171666371 0015773 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"bytes"
"fmt"
"hash/fnv"
"strings"
)
type graphviz struct {
ps []*gvnode
b bytes.Buffer
h map[string]uint32
}
type gvnode struct {
project string
version string
children []string
}
func (g graphviz) New() *graphviz {
ga := &graphviz{
ps: []*gvnode{},
h: make(map[string]uint32),
}
return ga
}
func (g graphviz) output() bytes.Buffer {
g.b.WriteString("digraph {\n\tnode [shape=box];")
for _, gvp := range g.ps {
// Create node string
g.b.WriteString(fmt.Sprintf("\n\t%d [label=\"%s\"];", gvp.hash(), gvp.label()))
}
// Store relations to avoid duplication
rels := make(map[string]bool)
// Create relations
for _, dp := range g.ps {
for _, bsc := range dp.children {
for pr, hsh := range g.h {
if isPathPrefix(bsc, pr) {
r := fmt.Sprintf("\n\t%d -> %d", g.h[dp.project], hsh)
if _, ex := rels[r]; !ex {
g.b.WriteString(r + ";")
rels[r] = true
}
}
}
}
}
g.b.WriteString("\n}")
return g.b
}
func (g *graphviz) createNode(project, version string, children []string) {
pr := &gvnode{
project: project,
version: version,
children: children,
}
g.h[pr.project] = pr.hash()
g.ps = append(g.ps, pr)
}
func (dp gvnode) hash() uint32 {
h := fnv.New32a()
h.Write([]byte(dp.project))
return h.Sum32()
}
func (dp gvnode) label() string {
label := []string{dp.project}
if dp.version != "" {
label = append(label, dp.version)
}
return strings.Join(label, "\\n")
}
// isPathPrefix ensures that the literal string prefix is a path tree match and
// guards against possibilities like this:
//
// github.com/sdboyer/foo
// github.com/sdboyer/foobar/baz
//
// Verify that prefix is path match and either the input is the same length as
// the match (in which case we know they're equal), or that the next character
// is a "/". (Import paths are defined to always use "/", not the OS-specific
// path separator.)
func isPathPrefix(path, pre string) bool {
pathlen, prflen := len(path), len(pre)
if pathlen < prflen || path[0:prflen] != pre {
return false
}
return prflen == pathlen || strings.Index(path[prflen:], "/") == 0
}
dep-0.3.2/cmd/dep/graphviz_test.go 0000664 0000000 0000000 00000003464 13171666371 0017041 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"testing"
"github.com/golang/dep/internal/test"
)
func TestEmptyProject(t *testing.T) {
h := test.NewHelper(t)
h.Parallel()
defer h.Cleanup()
g := new(graphviz).New()
b := g.output()
want := h.GetTestFileString("graphviz/empty.dot")
if b.String() != want {
t.Fatalf("expected '%v', got '%v'", want, b.String())
}
}
func TestSimpleProject(t *testing.T) {
h := test.NewHelper(t)
h.Parallel()
defer h.Cleanup()
g := new(graphviz).New()
g.createNode("project", "", []string{"foo", "bar"})
g.createNode("foo", "master", []string{"bar"})
g.createNode("bar", "dev", []string{})
b := g.output()
want := h.GetTestFileString("graphviz/case1.dot")
if b.String() != want {
t.Fatalf("expected '%v', got '%v'", want, b.String())
}
}
func TestNoLinks(t *testing.T) {
h := test.NewHelper(t)
h.Parallel()
defer h.Cleanup()
g := new(graphviz).New()
g.createNode("project", "", []string{})
b := g.output()
want := h.GetTestFileString("graphviz/case2.dot")
if b.String() != want {
t.Fatalf("expected '%v', got '%v'", want, b.String())
}
}
func TestIsPathPrefix(t *testing.T) {
t.Parallel()
tcs := []struct {
path string
pre string
want bool
}{
{"github.com/sdboyer/foo/bar", "github.com/sdboyer/foo", true},
{"github.com/sdboyer/foobar", "github.com/sdboyer/foo", false},
{"github.com/sdboyer/bar/foo", "github.com/sdboyer/foo", false},
{"golang.org/sdboyer/bar/foo", "github.com/sdboyer/foo", false},
{"golang.org/sdboyer/FOO", "github.com/sdboyer/foo", false},
}
for _, tc := range tcs {
r := isPathPrefix(tc.path, tc.pre)
if tc.want != r {
t.Fatalf("expected '%v', got '%v'", tc.want, r)
}
}
}
dep-0.3.2/cmd/dep/hash_in.go 0000664 0000000 0000000 00000002440 13171666371 0015552 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"flag"
"github.com/golang/dep"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/gps/pkgtree"
"github.com/pkg/errors"
)
func (cmd *hashinCommand) Name() string { return "hash-inputs" }
func (cmd *hashinCommand) Args() string { return "" }
func (cmd *hashinCommand) ShortHelp() string { return "" }
func (cmd *hashinCommand) LongHelp() string { return "" }
func (cmd *hashinCommand) Hidden() bool { return true }
func (cmd *hashinCommand) Register(fs *flag.FlagSet) {}
type hashinCommand struct{}
func (hashinCommand) Run(ctx *dep.Ctx, args []string) error {
p, err := ctx.LoadProject()
if err != nil {
return err
}
sm, err := ctx.SourceManager()
if err != nil {
return err
}
sm.UseDefaultSignalHandling()
defer sm.Release()
params := p.MakeParams()
params.RootPackageTree, err = pkgtree.ListPackages(p.ResolvedAbsRoot, string(p.ImportRoot))
if err != nil {
return errors.Wrap(err, "gps.ListPackages")
}
s, err := gps.Prepare(params, sm)
if err != nil {
return errors.Wrap(err, "prepare solver")
}
ctx.Out.Println(gps.HashingInputsAsString(s))
return nil
}
dep-0.3.2/cmd/dep/init.go 0000664 0000000 0000000 00000016131 13171666371 0015106 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"flag"
"io/ioutil"
"log"
"os"
"path/filepath"
"time"
"github.com/golang/dep"
"github.com/golang/dep/internal/fs"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/gps/paths"
"github.com/golang/dep/internal/gps/pkgtree"
"github.com/pkg/errors"
)
const initShortHelp = `Initialize a new project with manifest and lock files`
const initLongHelp = `
Initialize the project at filepath root by parsing its dependencies, writing
manifest and lock files, and vendoring the dependencies. If root isn't
specified, use the current directory.
When configuration for another dependency management tool is detected, it is
imported into the initial manifest and lock. Use the -skip-tools flag to
disable this behavior. The following external tools are supported:
glide, godep, vndr, govend, gb, gvt.
Any dependencies that are not constrained by external configuration use the
GOPATH analysis below.
By default, the dependencies are resolved over the network. A version will be
selected from the versions available from the upstream source per the following
algorithm:
- Tags conforming to semver (sorted by semver rules)
- Default branch(es) (sorted lexicographically)
- Non-semver tags (sorted lexicographically)
An alternate mode can be activated by passing -gopath. In this mode, the version
of each dependency will reflect the current state of the GOPATH. If a dependency
doesn't exist in the GOPATH, a version will be selected based on the above
network version selection algorithm.
A Gopkg.toml file will be written with inferred version constraints for all
direct dependencies. Gopkg.lock will be written with precise versions, and
vendor/ will be populated with the precise versions written to Gopkg.lock.
`
func (cmd *initCommand) Name() string { return "init" }
func (cmd *initCommand) Args() string { return "[root]" }
func (cmd *initCommand) ShortHelp() string { return initShortHelp }
func (cmd *initCommand) LongHelp() string { return initLongHelp }
func (cmd *initCommand) Hidden() bool { return false }
func (cmd *initCommand) Register(fs *flag.FlagSet) {
fs.BoolVar(&cmd.noExamples, "no-examples", false, "don't include example in Gopkg.toml")
fs.BoolVar(&cmd.skipTools, "skip-tools", false, "skip importing configuration from other dependency managers")
fs.BoolVar(&cmd.gopath, "gopath", false, "search in GOPATH for dependencies")
}
type initCommand struct {
noExamples bool
skipTools bool
gopath bool
}
func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error {
if len(args) > 1 {
return errors.Errorf("too many args (%d)", len(args))
}
var root string
if len(args) <= 0 {
root = ctx.WorkingDir
} else {
root = args[0]
if !filepath.IsAbs(args[0]) {
root = filepath.Join(ctx.WorkingDir, args[0])
}
if err := os.MkdirAll(root, os.FileMode(0777)); err != nil {
return errors.Wrapf(err, "unable to create directory %s", root)
}
}
var err error
p := new(dep.Project)
if err = p.SetRoot(root); err != nil {
return errors.Wrap(err, "NewProject")
}
ctx.GOPATH, err = ctx.DetectProjectGOPATH(p)
if err != nil {
return errors.Wrapf(err, "ctx.DetectProjectGOPATH")
}
mf := filepath.Join(root, dep.ManifestName)
lf := filepath.Join(root, dep.LockName)
vpath := filepath.Join(root, "vendor")
mok, err := fs.IsRegular(mf)
if err != nil {
return err
}
if mok {
return errors.Errorf("manifest already exists: %s", mf)
}
// Manifest file does not exist.
lok, err := fs.IsRegular(lf)
if err != nil {
return err
}
if lok {
return errors.Errorf("invalid state: manifest %q does not exist, but lock %q does", mf, lf)
}
ip, err := ctx.ImportForAbs(root)
if err != nil {
return errors.Wrap(err, "root project import")
}
p.ImportRoot = gps.ProjectRoot(ip)
sm, err := ctx.SourceManager()
if err != nil {
return errors.Wrap(err, "getSourceManager")
}
sm.UseDefaultSignalHandling()
defer sm.Release()
if ctx.Verbose {
ctx.Out.Println("Getting direct dependencies...")
}
pkgT, directDeps, err := getDirectDependencies(sm, p)
if err != nil {
return err
}
if ctx.Verbose {
ctx.Out.Printf("Checked %d directories for packages.\nFound %d direct dependencies.\n", len(pkgT.Packages), len(directDeps))
}
// Initialize with imported data, then fill in the gaps using the GOPATH
rootAnalyzer := newRootAnalyzer(cmd.skipTools, ctx, directDeps, sm)
p.Manifest, p.Lock, err = rootAnalyzer.InitializeRootManifestAndLock(root, p.ImportRoot)
if err != nil {
return err
}
if cmd.gopath {
gs := newGopathScanner(ctx, directDeps, sm)
err = gs.InitializeRootManifestAndLock(p.Manifest, p.Lock)
if err != nil {
return err
}
}
rootAnalyzer.skipTools = true // Don't import external config during solve for now
copyLock := *p.Lock // Copy lock before solving. Use this to separate new lock projects from solved lock
params := gps.SolveParameters{
RootDir: root,
RootPackageTree: pkgT,
Manifest: p.Manifest,
Lock: p.Lock,
ProjectAnalyzer: rootAnalyzer,
}
if ctx.Verbose {
params.TraceLogger = ctx.Err
}
if err := ctx.ValidateParams(sm, params); err != nil {
return err
}
s, err := gps.Prepare(params, sm)
if err != nil {
return errors.Wrap(err, "prepare solver")
}
soln, err := s.Solve()
if err != nil {
handleAllTheFailuresOfTheWorld(err)
return err
}
p.Lock = dep.LockFromSolution(soln)
rootAnalyzer.FinalizeRootManifestAndLock(p.Manifest, p.Lock, copyLock)
// Run gps.Prepare with appropriate constraint solutions from solve run
// to generate the final lock memo.
s, err = gps.Prepare(params, sm)
if err != nil {
return errors.Wrap(err, "prepare solver")
}
p.Lock.SolveMeta.InputsDigest = s.HashInputs()
// Pass timestamp (yyyyMMddHHmmss format) as suffix to backup name.
vendorbak, err := dep.BackupVendor(vpath, time.Now().Format("20060102150405"))
if err != nil {
return err
}
if vendorbak != "" {
ctx.Err.Printf("Old vendor backed up to %v", vendorbak)
}
sw, err := dep.NewSafeWriter(p.Manifest, nil, p.Lock, dep.VendorAlways)
if err != nil {
return err
}
logger := ctx.Err
if !ctx.Verbose {
logger = log.New(ioutil.Discard, "", 0)
}
if err := sw.Write(root, sm, !cmd.noExamples, logger); err != nil {
return errors.Wrap(err, "safe write of manifest and lock")
}
return nil
}
func getDirectDependencies(sm gps.SourceManager, p *dep.Project) (pkgtree.PackageTree, map[string]bool, error) {
pkgT, err := p.ParseRootPackageTree()
if err != nil {
return pkgtree.PackageTree{}, nil, err
}
directDeps := map[string]bool{}
rm, _ := pkgT.ToReachMap(true, true, false, nil)
for _, ip := range rm.FlattenFn(paths.IsStandardImportPath) {
pr, err := sm.DeduceProjectRoot(ip)
if err != nil {
return pkgtree.PackageTree{}, nil, err
}
directDeps[string(pr)] = true
}
return pkgT, directDeps, nil
}
// TODO solve failures can be really creative - we need to be similarly creative
// in handling them and informing the user appropriately
func handleAllTheFailuresOfTheWorld(err error) {
}
dep-0.3.2/cmd/dep/init_test.go 0000664 0000000 0000000 00000002032 13171666371 0016140 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"path/filepath"
"testing"
"github.com/golang/dep"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/test"
)
func TestGetDirectDependencies_ConsolidatesRootProjects(t *testing.T) {
h := test.NewHelper(t)
defer h.Cleanup()
ctx := NewTestContext(h)
sm, err := ctx.SourceManager()
h.Must(err)
defer sm.Release()
testprj := "directdepstest"
testdir := filepath.Join("src", testprj)
h.TempDir(testdir)
h.TempCopy(filepath.Join(testdir, "main.go"), "init/directdeps/main.go")
testpath := h.Path(testdir)
prj := &dep.Project{AbsRoot: testpath, ResolvedAbsRoot: testpath, ImportRoot: gps.ProjectRoot(testprj)}
_, dd, err := getDirectDependencies(sm, prj)
h.Must(err)
wantpr := "github.com/carolynvs/deptest-subpkg"
if _, has := dd[wantpr]; !has {
t.Fatalf("Expected direct dependencies to contain %s, got %v", wantpr, dd)
}
}
dep-0.3.2/cmd/dep/integration_test.go 0000664 0000000 0000000 00000007422 13171666371 0017530 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"github.com/golang/dep"
"github.com/golang/dep/internal/test"
"github.com/golang/dep/internal/test/integration"
)
func TestIntegration(t *testing.T) {
t.Parallel()
test.NeedsExternalNetwork(t)
test.NeedsGit(t)
wd, err := os.Getwd()
if err != nil {
t.Fatal(err)
}
relPath := filepath.Join("testdata", "harness_tests")
filepath.Walk(relPath, func(path string, info os.FileInfo, err error) error {
if err != nil {
t.Fatal("error walking filepath")
}
if filepath.Base(path) != "testcase.json" {
return nil
}
parse := strings.Split(path, string(filepath.Separator))
testName := strings.Join(parse[2:len(parse)-1], "/")
t.Run(testName, func(t *testing.T) {
t.Parallel()
t.Run("external", testIntegration(testName, relPath, wd, execCmd))
t.Run("internal", testIntegration(testName, relPath, wd, runMain))
})
return nil
})
}
// execCmd is a test.RunFunc which runs the program in another process.
func execCmd(prog string, args []string, stdout, stderr io.Writer, dir string, env []string) error {
cmd := exec.Command(prog, args...)
cmd.Stdout = stdout
cmd.Stderr = stderr
cmd.Env = env
cmd.Dir = dir
return cmd.Run()
}
// runMain is a test.RunFunc which runs the program in-process.
func runMain(prog string, args []string, stdout, stderr io.Writer, dir string, env []string) (err error) {
defer func() {
if r := recover(); r != nil {
switch r := r.(type) {
case error:
err = r
default:
err = fmt.Errorf("%v", r)
}
}
}()
m := &Config{
Args: append([]string{prog}, args...),
Stdout: stdout,
Stderr: stderr,
WorkingDir: dir,
Env: env,
}
if exitCode := m.Run(); exitCode != 0 {
err = fmt.Errorf("exit status %d", exitCode)
}
return
}
// testIntegration runs the test specified by ///testcase.json
func testIntegration(name, relPath, wd string, run integration.RunFunc) func(t *testing.T) {
return func(t *testing.T) {
t.Parallel()
// Set up environment
testCase := integration.NewTestCase(t, filepath.Join(wd, relPath), name)
testProj := integration.NewTestProject(t, testCase.InitialPath(), wd, run)
defer testProj.Cleanup()
// Create and checkout the vendor revisions
for ip, rev := range testCase.VendorInitial {
testProj.GetVendorGit(ip)
testProj.RunGit(testProj.VendorPath(ip), "checkout", rev)
}
// Create and checkout the import revisions
for ip, rev := range testCase.GopathInitial {
testProj.RunGo("get", ip)
testProj.RunGit(testProj.Path("src", ip), "checkout", rev)
}
// Run commands
testProj.RecordImportPaths()
var err error
for i, args := range testCase.Commands {
err = testProj.DoRun(args)
if err != nil && i < len(testCase.Commands)-1 {
t.Fatalf("cmd %s raised an unexpected error: %s", args[0], err.Error())
}
}
// Check error raised in final command
testCase.CompareError(err, testProj.GetStderr())
if *test.UpdateGolden {
testCase.UpdateOutput(testProj.GetStdout())
} else {
// Check output
testCase.CompareOutput(testProj.GetStdout())
}
// Check vendor paths
testProj.CompareImportPaths()
testCase.CompareVendorPaths(testProj.GetVendorPaths())
if *test.UpdateGolden {
// Update manifest and lock
testCase.UpdateFile(dep.ManifestName, testProj.ProjPath(dep.ManifestName))
testCase.UpdateFile(dep.LockName, testProj.ProjPath(dep.LockName))
} else {
// Check final manifest and lock
testCase.CompareFile(dep.ManifestName, testProj.ProjPath(dep.ManifestName))
testCase.CompareFile(dep.LockName, testProj.ProjPath(dep.LockName))
}
}
}
dep-0.3.2/cmd/dep/main.go 0000664 0000000 0000000 00000013465 13171666371 0015076 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Command dep is a prototype dependency management tool.
package main
import (
"bytes"
"flag"
"fmt"
"io"
"log"
"os"
"path/filepath"
"strings"
"text/tabwriter"
"github.com/golang/dep"
)
type command interface {
Name() string // "foobar"
Args() string // " [quux...]"
ShortHelp() string // "Foo the first bar"
LongHelp() string // "Foo the first bar meeting the following conditions..."
Register(*flag.FlagSet) // command-specific flags
Hidden() bool // indicates whether the command should be hidden from help output
Run(*dep.Ctx, []string) error
}
func main() {
wd, err := os.Getwd()
if err != nil {
fmt.Fprintln(os.Stderr, "failed to get working directory", err)
os.Exit(1)
}
c := &Config{
Args: os.Args,
Stdout: os.Stdout,
Stderr: os.Stderr,
WorkingDir: wd,
Env: os.Environ(),
}
os.Exit(c.Run())
}
// A Config specifies a full configuration for a dep execution.
type Config struct {
WorkingDir string // Where to execute
Args []string // Command-line arguments, starting with the program name.
Env []string // Environment variables
Stdout, Stderr io.Writer // Log output
}
// Run executes a configuration and returns an exit code.
func (c *Config) Run() (exitCode int) {
// Build the list of available commands.
commands := []command{
&initCommand{},
&statusCommand{},
&ensureCommand{},
&hashinCommand{},
&pruneCommand{},
&versionCommand{},
}
examples := [][2]string{
{
"dep init",
"set up a new project",
},
{
"dep ensure",
"install the project's dependencies",
},
{
"dep ensure -update",
"update the locked versions of all dependencies",
},
{
"dep ensure -add github.com/pkg/errors",
"add a dependency to the project",
},
}
outLogger := log.New(c.Stdout, "", 0)
errLogger := log.New(c.Stderr, "", 0)
usage := func() {
errLogger.Println("dep is a tool for managing dependencies for Go projects")
errLogger.Println()
errLogger.Println("Usage: dep ")
errLogger.Println()
errLogger.Println("Commands:")
errLogger.Println()
w := tabwriter.NewWriter(c.Stderr, 0, 4, 2, ' ', 0)
for _, cmd := range commands {
if !cmd.Hidden() {
fmt.Fprintf(w, "\t%s\t%s\n", cmd.Name(), cmd.ShortHelp())
}
}
w.Flush()
errLogger.Println()
errLogger.Println("Examples:")
for _, example := range examples {
fmt.Fprintf(w, "\t%s\t%s\n", example[0], example[1])
}
w.Flush()
errLogger.Println()
errLogger.Println("Use \"dep help [command]\" for more information about a command.")
}
cmdName, printCommandHelp, exit := parseArgs(c.Args)
if exit {
usage()
exitCode = 1
return
}
for _, cmd := range commands {
if cmd.Name() == cmdName {
// Build flag set with global flags in there.
fs := flag.NewFlagSet(cmdName, flag.ContinueOnError)
fs.SetOutput(c.Stderr)
verbose := fs.Bool("v", false, "enable verbose logging")
// Register the subcommand flags in there, too.
cmd.Register(fs)
// Override the usage text to something nicer.
resetUsage(errLogger, fs, cmdName, cmd.Args(), cmd.LongHelp())
if printCommandHelp {
fs.Usage()
exitCode = 1
return
}
// Parse the flags the user gave us.
// flag package automatically prints usage and error message in err != nil
// or if '-h' flag provided
if err := fs.Parse(c.Args[2:]); err != nil {
exitCode = 1
return
}
// Set up dep context.
ctx := &dep.Ctx{
Out: outLogger,
Err: errLogger,
Verbose: *verbose,
DisableLocking: getEnv(c.Env, "DEPNOLOCK") != "",
}
GOPATHS := filepath.SplitList(getEnv(c.Env, "GOPATH"))
ctx.SetPaths(c.WorkingDir, GOPATHS...)
// Run the command with the post-flag-processing args.
if err := cmd.Run(ctx, fs.Args()); err != nil {
errLogger.Printf("%v\n", err)
exitCode = 1
return
}
// Easy peasy livin' breezy.
return
}
}
errLogger.Printf("dep: %s: no such command\n", cmdName)
usage()
exitCode = 1
return
}
func resetUsage(logger *log.Logger, fs *flag.FlagSet, name, args, longHelp string) {
var (
hasFlags bool
flagBlock bytes.Buffer
flagWriter = tabwriter.NewWriter(&flagBlock, 0, 4, 2, ' ', 0)
)
fs.VisitAll(func(f *flag.Flag) {
hasFlags = true
// Default-empty string vars should read "(default: )"
// rather than the comparatively ugly "(default: )".
defValue := f.DefValue
if defValue == "" {
defValue = ""
}
fmt.Fprintf(flagWriter, "\t-%s\t%s (default: %s)\n", f.Name, f.Usage, defValue)
})
flagWriter.Flush()
fs.Usage = func() {
logger.Printf("Usage: dep %s %s\n", name, args)
logger.Println()
logger.Println(strings.TrimSpace(longHelp))
logger.Println()
if hasFlags {
logger.Println("Flags:")
logger.Println()
logger.Println(flagBlock.String())
}
}
}
// parseArgs determines the name of the dep command and whether the user asked for
// help to be printed.
func parseArgs(args []string) (cmdName string, printCmdUsage bool, exit bool) {
isHelpArg := func() bool {
return strings.Contains(strings.ToLower(args[1]), "help") || strings.ToLower(args[1]) == "-h"
}
switch len(args) {
case 0, 1:
exit = true
case 2:
if isHelpArg() {
exit = true
}
cmdName = args[1]
default:
if isHelpArg() {
cmdName = args[2]
printCmdUsage = true
} else {
cmdName = args[1]
}
}
return cmdName, printCmdUsage, exit
}
// getEnv returns the last instance of an environment variable.
func getEnv(env []string, key string) string {
for i := len(env) - 1; i >= 0; i-- {
v := env[i]
kv := strings.SplitN(v, "=", 2)
if kv[0] == key {
if len(kv) > 1 {
return kv[1]
}
return ""
}
}
return ""
}
dep-0.3.2/cmd/dep/prune.go 0000664 0000000 0000000 00000012437 13171666371 0015301 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"bytes"
"flag"
"io/ioutil"
"log"
"os"
"path/filepath"
"sort"
"strings"
"github.com/golang/dep"
"github.com/golang/dep/internal/fs"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/gps/pkgtree"
"github.com/pkg/errors"
)
const pruneShortHelp = `Prune the vendor tree of unused packages`
const pruneLongHelp = `
Prune is used to remove unused packages from your vendor tree.
STABILITY NOTICE: this command creates problems for vendor/ verification. As
such, it may be removed and/or moved out into a separate project later on.
`
type pruneCommand struct {
}
func (cmd *pruneCommand) Name() string { return "prune" }
func (cmd *pruneCommand) Args() string { return "" }
func (cmd *pruneCommand) ShortHelp() string { return pruneShortHelp }
func (cmd *pruneCommand) LongHelp() string { return pruneLongHelp }
func (cmd *pruneCommand) Hidden() bool { return false }
func (cmd *pruneCommand) Register(fs *flag.FlagSet) {
}
func (cmd *pruneCommand) Run(ctx *dep.Ctx, args []string) error {
p, err := ctx.LoadProject()
if err != nil {
return err
}
sm, err := ctx.SourceManager()
if err != nil {
return err
}
sm.UseDefaultSignalHandling()
defer sm.Release()
// While the network churns on ListVersions() requests, statically analyze
// code from the current project.
ptree, err := pkgtree.ListPackages(p.ResolvedAbsRoot, string(p.ImportRoot))
if err != nil {
return errors.Wrap(err, "analysis of local packages failed: %v")
}
// Set up a solver in order to check the InputHash.
params := p.MakeParams()
params.RootPackageTree = ptree
if ctx.Verbose {
params.TraceLogger = ctx.Err
}
s, err := gps.Prepare(params, sm)
if err != nil {
return errors.Wrap(err, "could not set up solver for input hashing")
}
if p.Lock == nil {
return errors.Errorf("Gopkg.lock must exist for prune to know what files are safe to remove.")
}
if !bytes.Equal(s.HashInputs(), p.Lock.SolveMeta.InputsDigest) {
return errors.Errorf("Gopkg.lock is out of sync; run dep ensure before pruning.")
}
pruneLogger := ctx.Err
if !ctx.Verbose {
pruneLogger = log.New(ioutil.Discard, "", 0)
}
return pruneProject(p, sm, pruneLogger)
}
// pruneProject removes unused packages from a project.
func pruneProject(p *dep.Project, sm gps.SourceManager, logger *log.Logger) error {
td, err := ioutil.TempDir(os.TempDir(), "dep")
if err != nil {
return errors.Wrap(err, "error while creating temp dir for writing manifest/lock/vendor")
}
defer os.RemoveAll(td)
if err := gps.WriteDepTree(td, p.Lock, sm, true, logger); err != nil {
return err
}
var toKeep []string
for _, project := range p.Lock.Projects() {
projectRoot := string(project.Ident().ProjectRoot)
for _, pkg := range project.Packages() {
toKeep = append(toKeep, filepath.Join(projectRoot, pkg))
}
}
toDelete, err := calculatePrune(td, toKeep, logger)
if err != nil {
return err
}
if len(toDelete) > 0 {
logger.Println("Calculated the following directories to prune:")
for _, d := range toDelete {
logger.Printf(" %s\n", d)
}
} else {
logger.Println("No directories found to prune")
}
if err := deleteDirs(toDelete); err != nil {
return err
}
vpath := filepath.Join(p.AbsRoot, "vendor")
vendorbak := vpath + ".orig"
var failerr error
if _, err := os.Stat(vpath); err == nil {
// Move out the old vendor dir. just do it into an adjacent dir, to
// try to mitigate the possibility of a pointless cross-filesystem
// move with a temp directory.
if _, err := os.Stat(vendorbak); err == nil {
// If the adjacent dir already exists, bite the bullet and move
// to a proper tempdir.
vendorbak = filepath.Join(td, "vendor.orig")
}
failerr = fs.RenameWithFallback(vpath, vendorbak)
if failerr != nil {
goto fail
}
}
// Move in the new one.
failerr = fs.RenameWithFallback(td, vpath)
if failerr != nil {
goto fail
}
os.RemoveAll(vendorbak)
return nil
fail:
fs.RenameWithFallback(vendorbak, vpath)
return failerr
}
func calculatePrune(vendorDir string, keep []string, logger *log.Logger) ([]string, error) {
logger.Println("Calculating prune. Checking the following packages:")
sort.Strings(keep)
toDelete := []string{}
err := filepath.Walk(vendorDir, func(path string, info os.FileInfo, err error) error {
if _, err := os.Lstat(path); err != nil {
return nil
}
if !info.IsDir() {
return nil
}
if path == vendorDir {
return nil
}
name := strings.TrimPrefix(path, vendorDir+string(filepath.Separator))
logger.Printf(" %s", name)
i := sort.Search(len(keep), func(i int) bool {
return name <= keep[i]
})
if i >= len(keep) || !strings.HasPrefix(keep[i], name) {
toDelete = append(toDelete, path)
}
return nil
})
return toDelete, err
}
func deleteDirs(toDelete []string) error {
// sort by length so we delete sub dirs first
sort.Sort(byLen(toDelete))
for _, path := range toDelete {
if err := os.RemoveAll(path); err != nil {
return err
}
}
return nil
}
type byLen []string
func (a byLen) Len() int { return len(a) }
func (a byLen) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a byLen) Less(i, j int) bool { return len(a[i]) > len(a[j]) }
dep-0.3.2/cmd/dep/prune_test.go 0000664 0000000 0000000 00000002240 13171666371 0016327 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"io/ioutil"
"log"
"path/filepath"
"reflect"
"sort"
"testing"
"github.com/golang/dep/internal/test"
)
func TestCalculatePrune(t *testing.T) {
h := test.NewHelper(t)
defer h.Cleanup()
vendorDir := "vendor"
h.TempDir(vendorDir)
h.TempDir(filepath.Join(vendorDir, "github.com/keep/pkg/sub"))
h.TempDir(filepath.Join(vendorDir, "github.com/prune/pkg/sub"))
toKeep := []string{
filepath.FromSlash("github.com/keep/pkg"),
filepath.FromSlash("github.com/keep/pkg/sub"),
}
discardLogger := log.New(ioutil.Discard, "", 0)
got, err := calculatePrune(h.Path(vendorDir), toKeep, discardLogger)
if err != nil {
t.Fatal(err)
}
sort.Sort(byLen(got))
want := []string{
h.Path(filepath.Join(vendorDir, "github.com/prune/pkg/sub")),
h.Path(filepath.Join(vendorDir, "github.com/prune/pkg")),
h.Path(filepath.Join(vendorDir, "github.com/prune")),
}
if !reflect.DeepEqual(want, got) {
t.Fatalf("calculated prune paths are not as expected.\n(WNT) %s\n(GOT) %s", want, got)
}
}
dep-0.3.2/cmd/dep/root_analyzer.go 0000664 0000000 0000000 00000010613 13171666371 0017032 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"io/ioutil"
"log"
"github.com/golang/dep"
fb "github.com/golang/dep/internal/feedback"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/importers"
)
// rootAnalyzer supplies manifest/lock data from both dep and external tool's
// configuration files.
// * When used on the root project, it imports only from external tools.
// * When used by the solver for dependencies, it first looks for dep config,
// then external tools.
type rootAnalyzer struct {
skipTools bool
ctx *dep.Ctx
sm gps.SourceManager
directDeps map[string]bool
}
func newRootAnalyzer(skipTools bool, ctx *dep.Ctx, directDeps map[string]bool, sm gps.SourceManager) *rootAnalyzer {
return &rootAnalyzer{
skipTools: skipTools,
ctx: ctx,
sm: sm,
directDeps: directDeps,
}
}
func (a *rootAnalyzer) InitializeRootManifestAndLock(dir string, pr gps.ProjectRoot) (rootM *dep.Manifest, rootL *dep.Lock, err error) {
if !a.skipTools {
rootM, rootL, err = a.importManifestAndLock(dir, pr, false)
if err != nil {
return
}
}
if rootM == nil {
rootM = dep.NewManifest()
}
if rootL == nil {
rootL = &dep.Lock{}
}
return
}
func (a *rootAnalyzer) importManifestAndLock(dir string, pr gps.ProjectRoot, suppressLogs bool) (*dep.Manifest, *dep.Lock, error) {
logger := a.ctx.Err
if suppressLogs {
logger = log.New(ioutil.Discard, "", 0)
}
for _, i := range importers.BuildAll(logger, a.ctx.Verbose, a.sm) {
if i.HasDepMetadata(dir) {
a.ctx.Err.Printf("Importing configuration from %s. These are only initial constraints, and are further refined during the solve process.", i.Name())
m, l, err := i.Import(dir, pr)
if err != nil {
return nil, nil, err
}
a.removeTransitiveDependencies(m)
return m, l, err
}
}
var emptyManifest = dep.NewManifest()
return emptyManifest, nil, nil
}
func (a *rootAnalyzer) removeTransitiveDependencies(m *dep.Manifest) {
for pr := range m.Constraints {
if _, isDirect := a.directDeps[string(pr)]; !isDirect {
delete(m.Constraints, pr)
}
}
}
// DeriveManifestAndLock evaluates a dependency for existing dependency manager
// configuration (ours or external) and passes any configuration found back
// to the solver.
func (a *rootAnalyzer) DeriveManifestAndLock(dir string, pr gps.ProjectRoot) (gps.Manifest, gps.Lock, error) {
// Ignore other tools if we find dep configuration
var depAnalyzer dep.Analyzer
if depAnalyzer.HasDepMetadata(dir) {
return depAnalyzer.DeriveManifestAndLock(dir, pr)
}
if !a.skipTools {
// The assignment back to an interface prevents interface-based nil checks from failing later
var manifest gps.Manifest = gps.SimpleManifest{}
var lock gps.Lock
im, il, err := a.importManifestAndLock(dir, pr, true)
if im != nil {
manifest = im
}
if il != nil {
lock = il
}
return manifest, lock, err
}
return gps.SimpleManifest{}, nil, nil
}
func (a *rootAnalyzer) FinalizeRootManifestAndLock(m *dep.Manifest, l *dep.Lock, ol dep.Lock) {
// Iterate through the new projects in solved lock and add them to manifest
// if they are direct deps and log feedback for all the new projects.
for _, y := range l.Projects() {
var f *fb.ConstraintFeedback
pr := y.Ident().ProjectRoot
// New constraints: in new lock and dir dep but not in manifest
if _, ok := a.directDeps[string(pr)]; ok {
if _, ok := m.Constraints[pr]; !ok {
pp := getProjectPropertiesFromVersion(y.Version())
if pp.Constraint != nil {
m.Constraints[pr] = pp
pc := gps.ProjectConstraint{Ident: y.Ident(), Constraint: pp.Constraint}
f = fb.NewConstraintFeedback(pc, fb.DepTypeDirect)
f.LogFeedback(a.ctx.Err)
}
f = fb.NewLockedProjectFeedback(y, fb.DepTypeDirect)
f.LogFeedback(a.ctx.Err)
}
} else {
// New locked projects: in new lock but not in old lock
newProject := true
for _, opl := range ol.Projects() {
if pr == opl.Ident().ProjectRoot {
newProject = false
}
}
if newProject {
f = fb.NewLockedProjectFeedback(y, fb.DepTypeTransitive)
f.LogFeedback(a.ctx.Err)
}
}
}
}
// Info provides metadata on the analyzer algorithm used during solve.
func (a *rootAnalyzer) Info() gps.ProjectAnalyzerInfo {
return gps.ProjectAnalyzerInfo{
Name: "dep",
Version: 1,
}
}
dep-0.3.2/cmd/dep/status.go 0000664 0000000 0000000 00000040734 13171666371 0015474 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"sort"
"sync"
"text/tabwriter"
"github.com/golang/dep"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/gps/paths"
"github.com/golang/dep/internal/gps/pkgtree"
"github.com/pkg/errors"
)
const statusShortHelp = `Report the status of the project's dependencies`
const statusLongHelp = `
With no arguments, print the status of each dependency of the project.
PROJECT Import path
CONSTRAINT Version constraint, from the manifest
VERSION Version chosen, from the lock
REVISION VCS revision of the chosen version
LATEST Latest VCS revision available
PKGS USED Number of packages from this project that are actually used
With one or more explicitly specified packages, or with the -detailed flag,
print an extended status output for each dependency of the project.
TODO Another column description
FOOBAR Another column description
Status returns exit code zero if all dependencies are in a "good state".
`
const (
shortRev uint8 = iota
longRev
)
var (
errFailedUpdate = errors.New("failed to fetch updates")
errFailedListPkg = errors.New("failed to list packages")
errMultipleFailures = errors.New("multiple sources of failure")
errInputDigestMismatch = errors.New("input-digest mismatch")
)
func (cmd *statusCommand) Name() string { return "status" }
func (cmd *statusCommand) Args() string { return "[package...]" }
func (cmd *statusCommand) ShortHelp() string { return statusShortHelp }
func (cmd *statusCommand) LongHelp() string { return statusLongHelp }
func (cmd *statusCommand) Hidden() bool { return false }
func (cmd *statusCommand) Register(fs *flag.FlagSet) {
fs.BoolVar(&cmd.detailed, "detailed", false, "report more detailed status")
fs.BoolVar(&cmd.json, "json", false, "output in JSON format")
fs.StringVar(&cmd.template, "f", "", "output in text/template format")
fs.BoolVar(&cmd.dot, "dot", false, "output the dependency graph in GraphViz format")
fs.BoolVar(&cmd.old, "old", false, "only show out-of-date dependencies")
fs.BoolVar(&cmd.missing, "missing", false, "only show missing dependencies")
fs.BoolVar(&cmd.unused, "unused", false, "only show unused dependencies")
fs.BoolVar(&cmd.modified, "modified", false, "only show modified dependencies")
}
type statusCommand struct {
detailed bool
json bool
template string
output string
dot bool
old bool
missing bool
unused bool
modified bool
}
type outputter interface {
BasicHeader()
BasicLine(*BasicStatus)
BasicFooter()
MissingHeader()
MissingLine(*MissingStatus)
MissingFooter()
}
type tableOutput struct{ w *tabwriter.Writer }
func (out *tableOutput) BasicHeader() {
fmt.Fprintf(out.w, "PROJECT\tCONSTRAINT\tVERSION\tREVISION\tLATEST\tPKGS USED\n")
}
func (out *tableOutput) BasicFooter() {
out.w.Flush()
}
func (out *tableOutput) BasicLine(bs *BasicStatus) {
fmt.Fprintf(out.w,
"%s\t%s\t%s\t%s\t%s\t%d\t\n",
bs.ProjectRoot,
bs.getConsolidatedConstraint(),
formatVersion(bs.Version),
formatVersion(bs.Revision),
bs.getConsolidatedLatest(shortRev),
bs.PackageCount,
)
}
func (out *tableOutput) MissingHeader() {
fmt.Fprintln(out.w, "PROJECT\tMISSING PACKAGES")
}
func (out *tableOutput) MissingLine(ms *MissingStatus) {
fmt.Fprintf(out.w,
"%s\t%s\t\n",
ms.ProjectRoot,
ms.MissingPackages,
)
}
func (out *tableOutput) MissingFooter() {
out.w.Flush()
}
type jsonOutput struct {
w io.Writer
basic []*rawStatus
missing []*MissingStatus
}
func (out *jsonOutput) BasicHeader() {
out.basic = []*rawStatus{}
}
func (out *jsonOutput) BasicFooter() {
json.NewEncoder(out.w).Encode(out.basic)
}
func (out *jsonOutput) BasicLine(bs *BasicStatus) {
out.basic = append(out.basic, bs.marshalJSON())
}
func (out *jsonOutput) MissingHeader() {
out.missing = []*MissingStatus{}
}
func (out *jsonOutput) MissingLine(ms *MissingStatus) {
out.missing = append(out.missing, ms)
}
func (out *jsonOutput) MissingFooter() {
json.NewEncoder(out.w).Encode(out.missing)
}
type dotOutput struct {
w io.Writer
o string
g *graphviz
p *dep.Project
}
func (out *dotOutput) BasicHeader() {
out.g = new(graphviz).New()
ptree, _ := out.p.ParseRootPackageTree()
// TODO(sdboyer) should be true, true, false, out.p.Manifest.IgnoredPackages()
prm, _ := ptree.ToReachMap(true, false, false, nil)
out.g.createNode(string(out.p.ImportRoot), "", prm.FlattenFn(paths.IsStandardImportPath))
}
func (out *dotOutput) BasicFooter() {
gvo := out.g.output()
fmt.Fprintf(out.w, gvo.String())
}
func (out *dotOutput) BasicLine(bs *BasicStatus) {
out.g.createNode(bs.ProjectRoot, bs.getConsolidatedVersion(), bs.Children)
}
func (out *dotOutput) MissingHeader() {}
func (out *dotOutput) MissingLine(ms *MissingStatus) {}
func (out *dotOutput) MissingFooter() {}
func (cmd *statusCommand) Run(ctx *dep.Ctx, args []string) error {
p, err := ctx.LoadProject()
if err != nil {
return err
}
sm, err := ctx.SourceManager()
if err != nil {
return err
}
sm.UseDefaultSignalHandling()
defer sm.Release()
if err := dep.ValidateProjectRoots(ctx, p.Manifest, sm); err != nil {
return err
}
var buf bytes.Buffer
var out outputter
switch {
case cmd.modified:
return errors.Errorf("not implemented")
case cmd.unused:
return errors.Errorf("not implemented")
case cmd.missing:
return errors.Errorf("not implemented")
case cmd.old:
return errors.Errorf("not implemented")
case cmd.detailed:
return errors.Errorf("not implemented")
case cmd.json:
out = &jsonOutput{
w: &buf,
}
case cmd.dot:
out = &dotOutput{
p: p,
o: cmd.output,
w: &buf,
}
default:
out = &tableOutput{
w: tabwriter.NewWriter(&buf, 0, 4, 2, ' ', 0),
}
}
// Check if the lock file exists.
if p.Lock == nil {
return errors.Errorf("no Gopkg.lock found. Run `dep ensure` to generate lock file")
}
hasMissingPkgs, errCount, err := runStatusAll(ctx, out, p, sm)
if err != nil {
switch err {
case errFailedUpdate:
// Print the results with unknown data
ctx.Out.Println(buf.String())
// Print the help when in non-verbose mode
if !ctx.Verbose {
ctx.Out.Printf("The status of %d projects are unknown due to errors. Rerun with `-v` flag to see details.\n", errCount)
}
case errInputDigestMismatch:
// Tell the user why mismatch happened and how to resolve it.
if hasMissingPkgs {
ctx.Err.Printf("Lock inputs-digest mismatch due to the following packages missing from the lock:\n\n")
ctx.Out.Print(buf.String())
ctx.Err.Printf("\nThis happens when a new import is added. Run `dep ensure` to install the missing packages.\n")
} else {
ctx.Err.Printf("Lock inputs-digest mismatch. This happens when Gopkg.toml is modified.\n" +
"Run `dep ensure` to regenerate the inputs-digest.")
}
}
return err
}
// Print the status output
ctx.Out.Print(buf.String())
return nil
}
type rawStatus struct {
ProjectRoot string
Constraint string
Version string
Revision string
Latest string
PackageCount int
}
// BasicStatus contains all the information reported about a single dependency
// in the summary/list status output mode.
type BasicStatus struct {
ProjectRoot string
Children []string
Constraint gps.Constraint
Version gps.UnpairedVersion
Revision gps.Revision
Latest gps.Version
PackageCount int
hasOverride bool
hasError bool
}
func (bs *BasicStatus) getConsolidatedConstraint() string {
var constraint string
if bs.Constraint != nil {
if v, ok := bs.Constraint.(gps.Version); ok {
constraint = formatVersion(v)
} else {
constraint = bs.Constraint.String()
}
}
if bs.hasOverride {
constraint += " (override)"
}
return constraint
}
func (bs *BasicStatus) getConsolidatedVersion() string {
version := formatVersion(bs.Revision)
if bs.Version != nil {
version = formatVersion(bs.Version)
}
return version
}
func (bs *BasicStatus) getConsolidatedLatest(revSize uint8) string {
latest := ""
if bs.Latest != nil {
switch revSize {
case shortRev:
latest = formatVersion(bs.Latest)
case longRev:
latest = bs.Latest.String()
}
}
if bs.hasError {
latest += "unknown"
}
return latest
}
func (bs *BasicStatus) marshalJSON() *rawStatus {
return &rawStatus{
ProjectRoot: bs.ProjectRoot,
Constraint: bs.getConsolidatedConstraint(),
Version: formatVersion(bs.Version),
Revision: string(bs.Revision),
Latest: bs.getConsolidatedLatest(longRev),
PackageCount: bs.PackageCount,
}
}
// MissingStatus contains information about all the missing packages in a project.
type MissingStatus struct {
ProjectRoot string
MissingPackages []string
}
func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceManager) (hasMissingPkgs bool, errCount int, err error) {
// While the network churns on ListVersions() requests, statically analyze
// code from the current project.
ptree, err := p.ParseRootPackageTree()
if err != nil {
return false, 0, err
}
// Set up a solver in order to check the InputHash.
params := gps.SolveParameters{
ProjectAnalyzer: dep.Analyzer{},
RootDir: p.AbsRoot,
RootPackageTree: ptree,
Manifest: p.Manifest,
// Locks aren't a part of the input hash check, so we can omit it.
}
logger := ctx.Err
if ctx.Verbose {
params.TraceLogger = ctx.Err
} else {
logger = log.New(ioutil.Discard, "", 0)
}
if err := ctx.ValidateParams(sm, params); err != nil {
return false, 0, err
}
s, err := gps.Prepare(params, sm)
if err != nil {
return false, 0, errors.Wrapf(err, "could not set up solver for input hashing")
}
cm := collectConstraints(ptree, p, sm)
// Get the project list and sort it so that the printed output users see is
// deterministically ordered. (This may be superfluous if the lock is always
// written in alpha order, but it doesn't hurt to double down.)
slp := p.Lock.Projects()
sort.Slice(slp, func(i, j int) bool {
return slp[i].Ident().Less(slp[j].Ident())
})
if bytes.Equal(s.HashInputs(), p.Lock.SolveMeta.InputsDigest) {
// If these are equal, we're guaranteed that the lock is a transitively
// complete picture of all deps. That eliminates the need for at least
// some checks.
out.BasicHeader()
logger.Println("Checking upstream projects:")
// BasicStatus channel to collect all the BasicStatus.
bsCh := make(chan *BasicStatus, len(slp))
// Error channels to collect different errors.
errListPkgCh := make(chan error, len(slp))
errListVerCh := make(chan error, len(slp))
var wg sync.WaitGroup
for i, proj := range slp {
wg.Add(1)
logger.Printf("(%d/%d) %s\n", i+1, len(slp), proj.Ident().ProjectRoot)
go func(proj gps.LockedProject) {
bs := BasicStatus{
ProjectRoot: string(proj.Ident().ProjectRoot),
PackageCount: len(proj.Packages()),
}
// Get children only for specific outputers
// in order to avoid slower status process.
switch out.(type) {
case *dotOutput:
ptr, err := sm.ListPackages(proj.Ident(), proj.Version())
if err != nil {
bs.hasError = true
errListPkgCh <- err
}
prm, _ := ptr.ToReachMap(true, true, false, p.Manifest.IgnoredPackages())
bs.Children = prm.FlattenFn(paths.IsStandardImportPath)
}
// Split apart the version from the lock into its constituent parts.
switch tv := proj.Version().(type) {
case gps.UnpairedVersion:
bs.Version = tv
case gps.Revision:
bs.Revision = tv
case gps.PairedVersion:
bs.Version = tv.Unpair()
bs.Revision = tv.Revision()
}
// Check if the manifest has an override for this project. If so,
// set that as the constraint.
if pp, has := p.Manifest.Ovr[proj.Ident().ProjectRoot]; has && pp.Constraint != nil {
bs.hasOverride = true
bs.Constraint = pp.Constraint
} else {
bs.Constraint = gps.Any()
for _, c := range cm[bs.ProjectRoot] {
bs.Constraint = c.Intersect(bs.Constraint)
}
}
// Only if we have a non-rev and non-plain version do/can we display
// anything wrt the version's updateability.
if bs.Version != nil && bs.Version.Type() != gps.IsVersion {
c, has := p.Manifest.Constraints[proj.Ident().ProjectRoot]
if !has {
c.Constraint = gps.Any()
}
// TODO: This constraint is only the constraint imposed by the
// current project, not by any transitive deps. As a result,
// transitive project deps will always show "any" here.
bs.Constraint = c.Constraint
vl, err := sm.ListVersions(proj.Ident())
if err == nil {
gps.SortPairedForUpgrade(vl)
for _, v := range vl {
// Because we've sorted the version list for
// upgrade, the first version we encounter that
// matches our constraint will be what we want.
if c.Constraint.Matches(v) {
bs.Latest = v.Revision()
break
}
}
} else {
// Failed to fetch version list (could happen due to
// network issue).
bs.hasError = true
errListVerCh <- err
}
}
bsCh <- &bs
wg.Done()
}(proj)
}
wg.Wait()
close(bsCh)
close(errListPkgCh)
close(errListVerCh)
// Newline after printing the status progress output.
logger.Println()
// List Packages errors. This would happen only for dot output.
if len(errListPkgCh) > 0 {
err = errFailedListPkg
if ctx.Verbose {
for err := range errListPkgCh {
ctx.Err.Println(err.Error())
}
ctx.Err.Println()
}
}
// List Version errors.
if len(errListVerCh) > 0 {
if err == nil {
err = errFailedUpdate
} else {
err = errMultipleFailures
}
// Count ListVersions error because we get partial results when
// this happens.
errCount = len(errListVerCh)
if ctx.Verbose {
for err := range errListVerCh {
ctx.Err.Println(err.Error())
}
ctx.Err.Println()
}
}
// A map of ProjectRoot and *BasicStatus. This is used in maintain the
// order of BasicStatus in output by collecting all the BasicStatus and
// then using them in order.
bsMap := make(map[string]*BasicStatus)
for bs := range bsCh {
bsMap[bs.ProjectRoot] = bs
}
// Use the collected BasicStatus in outputter.
for _, proj := range slp {
out.BasicLine(bsMap[string(proj.Ident().ProjectRoot)])
}
out.BasicFooter()
return false, errCount, err
}
// Hash digest mismatch may indicate that some deps are no longer
// needed, some are missing, or that some constraints or source
// locations have changed.
//
// It's possible for digests to not match, but still have a correct
// lock.
rm, _ := ptree.ToReachMap(true, true, false, p.Manifest.IgnoredPackages())
external := rm.FlattenFn(paths.IsStandardImportPath)
roots := make(map[gps.ProjectRoot][]string, len(external))
type fail struct {
ex string
err error
}
var errs []fail
for _, e := range external {
root, err := sm.DeduceProjectRoot(e)
if err != nil {
errs = append(errs, fail{
ex: e,
err: err,
})
continue
}
roots[root] = append(roots[root], e)
}
if len(errs) != 0 {
// TODO this is just a fix quick so staticcheck doesn't complain.
// Visually reconciling failure to deduce project roots with the rest of
// the mismatch output is a larger problem.
ctx.Err.Printf("Failed to deduce project roots for import paths:\n")
for _, fail := range errs {
ctx.Err.Printf("\t%s: %s\n", fail.ex, fail.err.Error())
}
return false, 0, errors.New("address issues with undeducible import paths to get more status information")
}
out.MissingHeader()
outer:
for root, pkgs := range roots {
// TODO also handle the case where the project is present, but there
// are items missing from just the package list
for _, lp := range slp {
if lp.Ident().ProjectRoot == root {
continue outer
}
}
hasMissingPkgs = true
out.MissingLine(&MissingStatus{ProjectRoot: string(root), MissingPackages: pkgs})
}
out.MissingFooter()
// We are here because of an input-digest mismatch. Return error.
return hasMissingPkgs, 0, errInputDigestMismatch
}
func formatVersion(v gps.Version) string {
if v == nil {
return ""
}
switch v.Type() {
case gps.IsBranch:
return "branch " + v.String()
case gps.IsRevision:
r := v.String()
if len(r) > 7 {
r = r[:7]
}
return r
}
return v.String()
}
func collectConstraints(ptree pkgtree.PackageTree, p *dep.Project, sm gps.SourceManager) map[string][]gps.Constraint {
// TODO
return map[string][]gps.Constraint{}
}
dep-0.3.2/cmd/dep/status_test.go 0000664 0000000 0000000 00000016715 13171666371 0016535 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"bytes"
"testing"
"text/tabwriter"
"strings"
"github.com/golang/dep"
"github.com/golang/dep/internal/gps"
)
func TestStatusFormatVersion(t *testing.T) {
t.Parallel()
tests := map[gps.Version]string{
nil: "",
gps.NewBranch("master"): "branch master",
gps.NewVersion("1.0.0"): "1.0.0",
gps.Revision("flooboofoobooo"): "flooboo",
}
for version, expected := range tests {
str := formatVersion(version)
if str != expected {
t.Fatalf("expected '%v', got '%v'", expected, str)
}
}
}
func TestBasicLine(t *testing.T) {
project := dep.Project{}
aSemverConstraint, _ := gps.NewSemverConstraint("1.2.3")
tests := []struct {
name string
status BasicStatus
wantDotStatus []string
wantJSONStatus []string
wantTableStatus []string
}{
{
name: "BasicStatus with ProjectRoot only",
status: BasicStatus{
ProjectRoot: "github.com/foo/bar",
},
wantDotStatus: []string{`[label="github.com/foo/bar"];`},
wantJSONStatus: []string{`"Version":""`, `"Revision":""`},
wantTableStatus: []string{`github.com/foo/bar 0`},
},
{
name: "BasicStatus with Revision",
status: BasicStatus{
ProjectRoot: "github.com/foo/bar",
Revision: gps.Revision("flooboofoobooo"),
},
wantDotStatus: []string{`[label="github.com/foo/bar\nflooboo"];`},
wantJSONStatus: []string{`"Version":""`, `"Revision":"flooboofoobooo"`, `"Constraint":""`},
wantTableStatus: []string{`github.com/foo/bar flooboo 0`},
},
{
name: "BasicStatus with Version and Revision",
status: BasicStatus{
ProjectRoot: "github.com/foo/bar",
Version: gps.NewVersion("1.0.0"),
Revision: gps.Revision("flooboofoobooo"),
},
wantDotStatus: []string{`[label="github.com/foo/bar\n1.0.0"];`},
wantJSONStatus: []string{`"Version":"1.0.0"`, `"Revision":"flooboofoobooo"`, `"Constraint":""`},
wantTableStatus: []string{`github.com/foo/bar 1.0.0 flooboo 0`},
},
{
name: "BasicStatus with Constraint, Version and Revision",
status: BasicStatus{
ProjectRoot: "github.com/foo/bar",
Constraint: aSemverConstraint,
Version: gps.NewVersion("1.0.0"),
Revision: gps.Revision("revxyz"),
},
wantDotStatus: []string{`[label="github.com/foo/bar\n1.0.0"];`},
wantJSONStatus: []string{`"Revision":"revxyz"`, `"Constraint":"1.2.3"`, `"Version":"1.0.0"`},
wantTableStatus: []string{`github.com/foo/bar 1.2.3 1.0.0 revxyz 0`},
},
{
name: "BasicStatus with update error",
status: BasicStatus{
ProjectRoot: "github.com/foo/bar",
hasError: true,
},
wantDotStatus: []string{`[label="github.com/foo/bar"];`},
wantJSONStatus: []string{`"Version":""`, `"Revision":""`, `"Latest":"unknown"`},
wantTableStatus: []string{`github.com/foo/bar unknown 0`},
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
var buf bytes.Buffer
dotout := &dotOutput{
p: &project,
w: &buf,
}
dotout.BasicHeader()
dotout.BasicLine(&test.status)
dotout.BasicFooter()
for _, wantStatus := range test.wantDotStatus {
if ok := strings.Contains(buf.String(), wantStatus); !ok {
t.Errorf("Did not find expected node status: \n\t(GOT) %v \n\t(WNT) %v", buf.String(), wantStatus)
}
}
buf.Reset()
jsonout := &jsonOutput{w: &buf}
jsonout.BasicHeader()
jsonout.BasicLine(&test.status)
jsonout.BasicFooter()
for _, wantStatus := range test.wantJSONStatus {
if ok := strings.Contains(buf.String(), wantStatus); !ok {
t.Errorf("Did not find expected JSON status: \n\t(GOT) %v \n\t(WNT) %v", buf.String(), wantStatus)
}
}
buf.Reset()
tabw := tabwriter.NewWriter(&buf, 0, 4, 2, ' ', 0)
tableout := &tableOutput{w: tabw}
tableout.BasicHeader()
tableout.BasicLine(&test.status)
tableout.BasicFooter()
for _, wantStatus := range test.wantTableStatus {
if ok := strings.Contains(buf.String(), wantStatus); !ok {
t.Errorf("Did not find expected Table status: \n\t(GOT) %v \n\t(WNT) %v", buf.String(), wantStatus)
}
}
})
}
}
func TestBasicStatusGetConsolidatedConstraint(t *testing.T) {
aSemverConstraint, _ := gps.NewSemverConstraint("1.2.1")
testCases := []struct {
name string
basicStatus BasicStatus
wantConstraint string
}{
{
name: "empty BasicStatus",
basicStatus: BasicStatus{},
wantConstraint: "",
},
{
name: "BasicStatus with Any Constraint",
basicStatus: BasicStatus{
Constraint: gps.Any(),
},
wantConstraint: "*",
},
{
name: "BasicStatus with Semver Constraint",
basicStatus: BasicStatus{
Constraint: aSemverConstraint,
},
wantConstraint: "1.2.1",
},
{
name: "BasicStatus with Override",
basicStatus: BasicStatus{
Constraint: aSemverConstraint,
hasOverride: true,
},
wantConstraint: "1.2.1 (override)",
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
if tc.basicStatus.getConsolidatedConstraint() != tc.wantConstraint {
t.Errorf("unexpected consolidated constraint: \n\t(GOT) %v \n\t(WNT) %v", tc.basicStatus.getConsolidatedConstraint(), tc.wantConstraint)
}
})
}
}
func TestBasicStatusGetConsolidatedVersion(t *testing.T) {
testCases := []struct {
name string
basicStatus BasicStatus
wantVersion string
}{
{
name: "empty BasicStatus",
basicStatus: BasicStatus{},
wantVersion: "",
},
{
name: "BasicStatus with Version and Revision",
basicStatus: BasicStatus{
Version: gps.NewVersion("1.0.0"),
Revision: gps.Revision("revxyz"),
},
wantVersion: "1.0.0",
},
{
name: "BasicStatus with only Revision",
basicStatus: BasicStatus{
Revision: gps.Revision("revxyz"),
},
wantVersion: "revxyz",
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
if tc.basicStatus.getConsolidatedVersion() != tc.wantVersion {
t.Errorf("unexpected consolidated version: \n\t(GOT) %v \n\t(WNT) %v", tc.basicStatus.getConsolidatedVersion(), tc.wantVersion)
}
})
}
}
func TestBasicStatusGetConsolidatedLatest(t *testing.T) {
testCases := []struct {
name string
basicStatus BasicStatus
revSize uint8
wantLatest string
}{
{
name: "empty BasicStatus",
basicStatus: BasicStatus{},
revSize: shortRev,
wantLatest: "",
},
{
name: "nil latest",
basicStatus: BasicStatus{
Latest: nil,
},
revSize: shortRev,
wantLatest: "",
},
{
name: "with error",
basicStatus: BasicStatus{
hasError: true,
},
revSize: shortRev,
wantLatest: "unknown",
},
{
name: "short latest",
basicStatus: BasicStatus{
Latest: gps.Revision("adummylonglongrevision"),
},
revSize: shortRev,
wantLatest: "adummyl",
},
{
name: "long latest",
basicStatus: BasicStatus{
Latest: gps.Revision("adummylonglongrevision"),
},
revSize: longRev,
wantLatest: "adummylonglongrevision",
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
gotRev := tc.basicStatus.getConsolidatedLatest(tc.revSize)
if gotRev != tc.wantLatest {
t.Errorf("unexpected consolidated latest: \n\t(GOT) %v \n\t(WNT) %v", gotRev, tc.wantLatest)
}
})
}
}
dep-0.3.2/cmd/dep/testdata/ 0000775 0000000 0000000 00000000000 13171666371 0015423 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/graphviz/ 0000775 0000000 0000000 00000000000 13171666371 0017255 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/graphviz/case1.dot 0000664 0000000 0000000 00000000321 13171666371 0020755 0 ustar 00root root 0000000 0000000 digraph {
node [shape=box];
4106060478 [label="project"];
2851307223 [label="foo\nmaster"];
1991736602 [label="bar\ndev"];
4106060478 -> 2851307223;
4106060478 -> 1991736602;
2851307223 -> 1991736602;
} dep-0.3.2/cmd/dep/testdata/graphviz/case2.dot 0000664 0000000 0000000 00000000075 13171666371 0020764 0 ustar 00root root 0000000 0000000 digraph {
node [shape=box];
4106060478 [label="project"];
} dep-0.3.2/cmd/dep/testdata/graphviz/empty.dot 0000664 0000000 0000000 00000000036 13171666371 0021122 0 ustar 00root root 0000000 0000000 digraph {
node [shape=box];
} dep-0.3.2/cmd/dep/testdata/harness_tests/ 0000775 0000000 0000000 00000000000 13171666371 0020310 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/README.md 0000664 0000000 0000000 00000007203 13171666371 0021571 0 ustar 00root root 0000000 0000000 # golang/dep Integration Tests
The `dep` integration tests use a consistent directory structure under `testdata`
to set up the initial project state, run `dep` commands, then check against an
expected final state to see if the test passes.
The directory structure is as follows:
testdata/
harness_tests/
category1/
subcategory1/
case1/
testcase.json
stdout.txt
initial/
file1.go
Gopkg.toml
...
final/
Gopkg.toml
Gopkg.lock
case2/
...
The test code itself simply walks down the directory tree, looking for
`testcase.json` files. These files can be as many levels down the tree as
desired. The test name will consist of the directory path from `testdata` to
the test case directory itself. In the above example, the test name would be
`category1/subcategory1/case1`, and could be singled out with the `-run` option
of `go test` (i.e.
`go test github.com/golang/dep/cmd/dep -run Integration/category1/subcategory1/case1`).
New tests can be added simply by adding a new directory with the json file to
the `testdata` tree. There is no need for code modification - the new test
will be included automatically.
The json file needs to be accompanied by `initial` and `final` directories. The
`initial` is copied verbatim into the test project before the `dep` commands are
run, and the `manifest` and `lock` files in `final`, if present, are used to
compare against the test project results after the commands. The `stdout.txt` file
is optional, and if present will be compared with command output.
The `testcase.json` file has the following format:
{
"commands": [
["init"],
["ensure", "github.com/sdboyer/deptesttres"]
],
"gopath-initial": {
"github.com/sdboyer/deptest": "v0.8.0",
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"
},
"vendor-initial": {
"github.com/sdboyer/deptesttres": "v2.1.0",
"github.com/sdboyer/deptestquatro": "cf596baa11ea047ddf8797287451d36b861bab45"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos",
"github.com/sdboyer/deptesttres",
"github.com/sdboyer/deptestquatro"
],
"error-expected": "something went wrong"
}
All of the categories are optional - if the `imports` list for a test is empty,
for example, it can be completely left out.
The test procedure is as follows:
1. Create a unique temporary directory (TMPDIR) as the test run's `GOPATH`
2. Create `$TMPDIR/src/github.com/golang/notexist` as the current project
3. Copy the contents of `initial` input directory to the project
4. Fetch the repos and versions in `gopath-initial` into `$TMPDIR/src` directory
5. Fetch the repos and versions in `vendor-initial` to the project's `vendor` directory
6. Run `commands` on the project, in declaration order
7. Ensure that, if any errors are raised, it is only by the final command and their string output matches `error-expected`
8. Ensure that, if a stdout.txt file is present, the command's output matches (excluding trailing whitespace).
9. Check the resulting files against those in the `final` input directory
10. Check the `vendor` directory for the projects listed under `vendor-final`
11. Check that there were no changes to `src` listings
12. Clean up
Note that for the remote fetches, only git repos are currently supported.
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/ 0000775 0000000 0000000 00000000000 13171666371 0021611 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/ 0000775 0000000 0000000 00000000000 13171666371 0022341 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double-spec/ 0000775 0000000 0000000 00000000000 13171666371 0026100 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double-spec/final/ 0000775 0000000 0000000 00000000000 13171666371 0027171 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double-spec/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0031104 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
version = "v0.8.1"
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "645b5b52e1bfb9e3db1cefde758485e009edfe5bad611b490582d94467f9c1b0"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double-spec/final/Gopkg.toml 0000664 0000000 0000000 00000000230 13171666371 0031130 0 ustar 00root root 0000000 0000000
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "0.8.1"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double-spec/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027531 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double-spec/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0031002 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptesttres"
)
func main() {
type a deptesttres.Bar
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double-spec/testcase.json 0000664 0000000 0000000 00000000364 13171666371 0030611 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"],
["ensure", "-add", "github.com/sdboyer/deptest", "github.com/sdboyer/deptest@v0.8.1"]
],
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptesttres"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double/ 0000775 0000000 0000000 00000000000 13171666371 0025150 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double/final/ 0000775 0000000 0000000 00000000000 13171666371 0026241 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double/final/Gopkg.lock 0000664 0000000 0000000 00000001120 13171666371 0030154 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = [".","subp"]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "432bc141db9511df4e1b5754c6c4d8cf4dd8b4f8d5a13fd7d189c17c14e000b7"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double/final/Gopkg.toml 0000664 0000000 0000000 00000000230 13171666371 0030200 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double/initial/ 0000775 0000000 0000000 00000000000 13171666371 0026601 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double/initial/main.go 0000664 0000000 0000000 00000000374 13171666371 0030060 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
)
func main() {
type a deptest.Bar
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-double/testcase.json 0000664 0000000 0000000 00000000372 13171666371 0027660 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"],
["ensure", "-add", "github.com/sdboyer/deptesttres", "github.com/sdboyer/deptesttres/subp"]
],
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptesttres"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-spec/ 0000775 0000000 0000000 00000000000 13171666371 0024630 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-spec/final/ 0000775 0000000 0000000 00000000000 13171666371 0025721 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-spec/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0027634 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
version = "v0.8.1"
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "645b5b52e1bfb9e3db1cefde758485e009edfe5bad611b490582d94467f9c1b0"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-spec/final/Gopkg.toml 0000664 0000000 0000000 00000000230 13171666371 0027660 0 ustar 00root root 0000000 0000000
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "0.8.1"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-spec/initial/ 0000775 0000000 0000000 00000000000 13171666371 0026261 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-spec/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0027532 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptesttres"
)
func main() {
type a deptesttres.Bar
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new-spec/testcase.json 0000664 0000000 0000000 00000000326 13171666371 0027337 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"],
["ensure", "-add", "github.com/sdboyer/deptest@v0.8.1"]
],
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptesttres"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new/ 0000775 0000000 0000000 00000000000 13171666371 0023700 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new/final/ 0000775 0000000 0000000 00000000000 13171666371 0024771 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0026704 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "8f0b74fd1169808bd0e31dd7ad6c601c7b8f7ef25eec9e8a45e72b8a384ebb5c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new/final/Gopkg.toml 0000664 0000000 0000000 00000000230 13171666371 0026730 0 ustar 00root root 0000000 0000000
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025331 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0026602 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptesttres"
)
func main() {
type a deptesttres.Bar
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/all-new/testcase.json 0000664 0000000 0000000 00000000317 13171666371 0026407 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"],
["ensure", "-add", "github.com/sdboyer/deptest"]
],
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptesttres"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/ 0000775 0000000 0000000 00000000000 13171666371 0023626 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/final/ 0000775 0000000 0000000 00000000000 13171666371 0024717 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/final/Gopkg.lock 0000664 0000000 0000000 00000001340 13171666371 0026636 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "86240895e0ee5788e7e8bb56e0d77afd58009a491b69f6835e546db9e5dacfcd"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/final/Gopkg.toml 0000664 0000000 0000000 00000000227 13171666371 0026664 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0"
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/final/main.go 0000664 0000000 0000000 00000000536 13171666371 0026176 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)
func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025257 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/initial/Gopkg.lock 0000664 0000000 0000000 00000000665 13171666371 0027207 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "9a7bd6944c26792ab2e97fed1227cc402f0cc00465016836efbf04239596dd9f"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0027214 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0" dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/initial/main.go 0000664 0000000 0000000 00000000631 13171666371 0026532 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
"github.com/sdboyer/deptesttres"
)
func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
type a deptesttres.Bar
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/stdout.txt 0000664 0000000 0000000 00000000141 13171666371 0025705 0 ustar 00root root 0000000 0000000 Warning: Gopkg.lock is out of sync with Gopkg.toml or the project's imports.
Fetching sources...
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/desync/testcase.json 0000664 0000000 0000000 00000000343 13171666371 0026334 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-add", "github.com/sdboyer/deptesttres@master"]
],
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos",
"github.com/sdboyer/deptesttres"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/ 0000775 0000000 0000000 00000000000 13171666371 0023314 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/double-diff-spec/ 0000775 0000000 0000000 00000000000 13171666371 0026424 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/double-diff-spec/final/ 0000775 0000000 0000000 00000000000 13171666371 0027515 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/double-diff-spec/final/Gopkg.lock 0000664 0000000 0000000 00000000665 13171666371 0031445 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "342afd8c8a616d084eb7b67bf3a891710eca3ce5abc3cf60af0dae4ccfdcd001"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/double-diff-spec/final/Gopkg.toml 0000664 0000000 0000000 00000000116 13171666371 0031457 0 ustar 00root root 0000000 0000000
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/double-diff-spec/initial/ 0000775 0000000 0000000 00000000000 13171666371 0030055 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/double-diff-spec/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0031326 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptesttres"
)
func main() {
type a deptesttres.Bar
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/double-diff-spec/testcase.json 0000664 0000000 0000000 00000000540 13171666371 0031131 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"],
["ensure", "-add", "github.com/sdboyer/deptest@0.8.1", "github.com/sdboyer/deptest@1.0.0"]
],
"vendor-final": [
"github.com/sdboyer/deptesttres"
],
"error-expected": "can only specify rules once per project being added; rules were given at least twice for github.com/sdboyer/deptest"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists-manifest/ 0000775 0000000 0000000 00000000000 13171666371 0026437 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists-manifest/final/ 0000775 0000000 0000000 00000000000 13171666371 0027530 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists-manifest/final/Gopkg.lock 0000664 0000000 0000000 00000000665 13171666371 0031460 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "342afd8c8a616d084eb7b67bf3a891710eca3ce5abc3cf60af0dae4ccfdcd001"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists-manifest/final/Gopkg.toml 0000664 0000000 0000000 00000000227 13171666371 0031475 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptesttres"
branch = "master"
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists-manifest/initial/ 0000775 0000000 0000000 00000000000 13171666371 0030070 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists-manifest/initial/Gopkg.lock 0000664 0000000 0000000 00000000665 13171666371 0032020 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "342afd8c8a616d084eb7b67bf3a891710eca3ce5abc3cf60af0dae4ccfdcd001"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists-manifest/initial/Gopkg.toml 0000664 0000000 0000000 00000000227 13171666371 0032035 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptesttres"
branch = "master"
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists-manifest/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0031341 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptesttres"
)
func main() {
type a deptesttres.Bar
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists-manifest/testcase.json 0000664 0000000 0000000 00000000320 13171666371 0031140 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-add", "github.com/sdboyer/deptest@1.0.0"]
],
"error-expected": "Gopkg.toml already contains rules for github.com/sdboyer/deptest, cannot specify a version constraint"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/ 0000775 0000000 0000000 00000000000 13171666371 0024633 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/final/ 0000775 0000000 0000000 00000000000 13171666371 0025724 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0027651 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/final/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0027661 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/initial/ 0000775 0000000 0000000 00000000000 13171666371 0026264 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0030211 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0030221 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0027535 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
)
func main() {
_ := deptest.Map["yo yo!"]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/exists/testcase.json 0000664 0000000 0000000 00000000333 13171666371 0027340 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-add", "github.com/sdboyer/deptest"]
],
"error-expected": "nothing to -add, github.com/sdboyer/deptest is already in Gopkg.toml and the project's direct imports or required list"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/noarg/ 0000775 0000000 0000000 00000000000 13171666371 0024422 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/noarg/final/ 0000775 0000000 0000000 00000000000 13171666371 0025513 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/noarg/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0027426 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
version = "v0.8.0"
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
packages = ["."]
[[projects]]
name = "github.com/sdboyer/deptestdos"
version = "v2.0.0"
revision = "5c607206be5decd28e6263ffffdcee067266015e"
packages = ["."]
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "9b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/noarg/final/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0027450 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0" dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/noarg/final/main.go 0000664 0000000 0000000 00000000536 13171666371 0026772 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)
func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/noarg/initial/ 0000775 0000000 0000000 00000000000 13171666371 0026053 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/noarg/initial/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0027766 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
version = "v0.8.0"
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
packages = ["."]
[[projects]]
name = "github.com/sdboyer/deptestdos"
version = "v2.0.0"
revision = "5c607206be5decd28e6263ffffdcee067266015e"
packages = ["."]
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "9b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/noarg/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0030010 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0" dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/noarg/initial/main.go 0000664 0000000 0000000 00000000536 13171666371 0027332 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)
func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/noarg/testcase.json 0000664 0000000 0000000 00000000173 13171666371 0027131 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-add"]
],
"error-expected": "must specify at least one project or package to -add"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/ 0000775 0000000 0000000 00000000000 13171666371 0024773 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case1/ 0000775 0000000 0000000 00000000000 13171666371 0025767 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case1/final/ 0000775 0000000 0000000 00000000000 13171666371 0027060 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case1/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0031005 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case1/final/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0031015 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case1/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027420 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case1/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0031345 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case1/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0031355 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case1/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0030671 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
)
func main() {
_ := deptest.Map["yo yo!"]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case1/testcase.json 0000664 0000000 0000000 00000000211 13171666371 0030467 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-add", "github.com/golang/notexist"]
],
"error-expected": "cannot add current project to itself"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case2/ 0000775 0000000 0000000 00000000000 13171666371 0025770 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case2/final/ 0000775 0000000 0000000 00000000000 13171666371 0027061 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case2/final/Gopkg.lock 0000664 0000000 0000000 00000000436 13171666371 0031005 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case2/final/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0031013 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case2/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027421 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case2/initial/main.go 0000664 0000000 0000000 00000000275 13171666371 0030700 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func main() {}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/errs/self-add/case2/testcase.json 0000664 0000000 0000000 00000000247 13171666371 0030501 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"],
["ensure", "-add", "github.com/golang/notexist"]
],
"error-expected": "cannot add current project to itself"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-imports/ 0000775 0000000 0000000 00000000000 13171666371 0025353 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-imports/final/ 0000775 0000000 0000000 00000000000 13171666371 0026444 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-imports/final/Gopkg.lock 0000664 0000000 0000000 00000000665 13171666371 0030374 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "342afd8c8a616d084eb7b67bf3a891710eca3ce5abc3cf60af0dae4ccfdcd001"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-imports/final/Gopkg.toml 0000664 0000000 0000000 00000000116 13171666371 0030406 0 ustar 00root root 0000000 0000000
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-imports/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027004 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-imports/initial/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0030736 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-imports/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0030255 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptesttres"
)
func main() {
type a deptesttres.Bar
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-imports/testcase.json 0000664 0000000 0000000 00000000230 13171666371 0030054 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-add", "github.com/sdboyer/deptesttres@master"]
],
"vendor-final": [
"github.com/sdboyer/deptesttres"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-manifest-constraint/ 0000775 0000000 0000000 00000000000 13171666371 0027646 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-manifest-constraint/final/ 0000775 0000000 0000000 00000000000 13171666371 0030737 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-manifest-constraint/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0032652 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "d1fe1d4f4dd98b75908b524bd73d43a4b9e3ce0b9522ea6ce9d6c9ea15190c1d"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-manifest-constraint/final/Gopkg.toml 0000664 0000000 0000000 00000000227 13171666371 0032704 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptesttres"
branch = "master"
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-manifest-constraint/initial/ 0000775 0000000 0000000 00000000000 13171666371 0031277 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-manifest-constraint/initial/Gopkg.lock 0000664 0000000 0000000 00000000665 13171666371 0033227 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
packages = ["."]
revision = "54aaeb0023e1f3dcf5f98f31dd8c565457945a12"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "342afd8c8a616d084eb7b67bf3a891710eca3ce5abc3cf60af0dae4ccfdcd001"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-manifest-constraint/initial/Gopkg.toml 0000664 0000000 0000000 00000000227 13171666371 0033244 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptesttres"
branch = "master"
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-manifest-constraint/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0032550 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptesttres"
)
func main() {
type a deptesttres.Bar
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/add/exists-manifest-constraint/testcase.json 0000664 0000000 0000000 00000000261 13171666371 0032353 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-add", "github.com/sdboyer/deptest"]
],
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptesttres"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/ 0000775 0000000 0000000 00000000000 13171666371 0023235 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/ 0000775 0000000 0000000 00000000000 13171666371 0024210 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/lockless-vendoronly/ 0000775 0000000 0000000 00000000000 13171666371 0030224 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/lockless-vendoronly/final/ 0000775 0000000 0000000 00000000000 13171666371 0031315 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/lockless-vendoronly/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0033253 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/lockless-vendoronly/final/main.go 0000664 0000000 0000000 00000000352 13171666371 0032570 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/lockless-vendoronly/initial/ 0000775 0000000 0000000 00000000000 13171666371 0031655 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/lockless-vendoronly/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0033613 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/lockless-vendoronly/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0033130 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/lockless-vendoronly/testcase.json 0000664 0000000 0000000 00000000202 13171666371 0032724 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-vendor-only"]
],
"error-expected": "no Gopkg.lock exists from which to populate vendor/"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/specargs/ 0000775 0000000 0000000 00000000000 13171666371 0026017 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/specargs/final/ 0000775 0000000 0000000 00000000000 13171666371 0027110 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/specargs/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0031035 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/specargs/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0031046 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/specargs/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027450 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/specargs/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0031375 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/specargs/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0031406 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/specargs/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0030723 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/errs/specargs/testcase.json 0000664 0000000 0000000 00000000212 13171666371 0030520 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "foobar.com/baz"]
],
"error-expected": "dep ensure only takes spec arguments with -add or -update"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-dry/ 0000775 0000000 0000000 00000000000 13171666371 0025302 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-dry/final/ 0000775 0000000 0000000 00000000000 13171666371 0026373 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-dry/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0030320 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-dry/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0030331 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-dry/initial/ 0000775 0000000 0000000 00000000000 13171666371 0026733 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-dry/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0030660 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-dry/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0030671 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-dry/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0030206 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-dry/testcase.json 0000664 0000000 0000000 00000000063 13171666371 0030007 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-dry-run"]
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor-dry/ 0000775 0000000 0000000 00000000000 13171666371 0027132 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor-dry/final/ 0000775 0000000 0000000 00000000000 13171666371 0030223 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor-dry/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0032150 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor-dry/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0032161 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor-dry/initial/ 0000775 0000000 0000000 00000000000 13171666371 0030563 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor-dry/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0032510 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor-dry/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0032521 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor-dry/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0032036 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor-dry/testcase.json 0000664 0000000 0000000 00000000101 13171666371 0031630 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-no-vendor", "-dry-run"]
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor/ 0000775 0000000 0000000 00000000000 13171666371 0026336 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor/final/ 0000775 0000000 0000000 00000000000 13171666371 0027427 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0031354 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0031365 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027767 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0031714 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0031725 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0031242 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq-novendor/testcase.json 0000664 0000000 0000000 00000000065 13171666371 0031045 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-no-vendor"]
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq/ 0000775 0000000 0000000 00000000000 13171666371 0024506 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq/final/ 0000775 0000000 0000000 00000000000 13171666371 0025577 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0027524 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0027535 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq/initial/ 0000775 0000000 0000000 00000000000 13171666371 0026137 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0030064 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0030075 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0027412 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hasheq/testcase.json 0000664 0000000 0000000 00000000141 13171666371 0027210 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure"]
],
"vendor-final": [
"github.com/sdboyer/deptest"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-novendor-dry/ 0000775 0000000 0000000 00000000000 13171666371 0027310 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-novendor-dry/final/ 0000775 0000000 0000000 00000000000 13171666371 0030401 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-novendor-dry/final/Gopkg.lock 0000664 0000000 0000000 00000000770 13171666371 0032326 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
# manually modified hash digest, it will not match any known inputs
inputs-digest = "94b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-novendor-dry/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0032337 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-novendor-dry/initial/ 0000775 0000000 0000000 00000000000 13171666371 0030741 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-novendor-dry/initial/Gopkg.lock 0000664 0000000 0000000 00000000770 13171666371 0032666 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
# manually modified hash digest, it will not match any known inputs
inputs-digest = "94b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-novendor-dry/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0032677 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-novendor-dry/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0032214 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-novendor-dry/testcase.json 0000664 0000000 0000000 00000000166 13171666371 0032021 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-no-vendor", "-dry-run"]
],
"error-expected": "Gopkg.lock was not up to date"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-vendoronly/ 0000775 0000000 0000000 00000000000 13171666371 0027061 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-vendoronly/final/ 0000775 0000000 0000000 00000000000 13171666371 0030152 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-vendoronly/final/Gopkg.lock 0000664 0000000 0000000 00000000770 13171666371 0032077 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
# manually modified hash digest, it will not match any known inputs
inputs-digest = "94b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-vendoronly/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0032110 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-vendoronly/initial/ 0000775 0000000 0000000 00000000000 13171666371 0030512 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-vendoronly/initial/Gopkg.lock 0000664 0000000 0000000 00000000770 13171666371 0032437 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
# manually modified hash digest, it will not match any known inputs
inputs-digest = "94b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-vendoronly/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0032450 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-vendoronly/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0031765 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/hashneq-vendoronly/testcase.json 0000664 0000000 0000000 00000000161 13171666371 0031565 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-vendor-only"]
],
"vendor-final": [
"github.com/sdboyer/deptest"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/nocode-vendoronly/ 0000775 0000000 0000000 00000000000 13171666371 0026701 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/nocode-vendoronly/final/ 0000775 0000000 0000000 00000000000 13171666371 0027772 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/nocode-vendoronly/final/Gopkg.lock 0000664 0000000 0000000 00000000770 13171666371 0031717 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
# manually modified hash digest, it will not match any known inputs
inputs-digest = "94b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/nocode-vendoronly/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0031730 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/nocode-vendoronly/initial/ 0000775 0000000 0000000 00000000000 13171666371 0030332 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/nocode-vendoronly/initial/Gopkg.lock 0000664 0000000 0000000 00000000770 13171666371 0032257 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
# manually modified hash digest, it will not match any known inputs
inputs-digest = "94b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/nocode-vendoronly/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0032270 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/default/nocode-vendoronly/testcase.json 0000664 0000000 0000000 00000000161 13171666371 0031405 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-vendor-only"]
],
"vendor-final": [
"github.com/sdboyer/deptest"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/ 0000775 0000000 0000000 00000000000 13171666371 0022747 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case1/ 0000775 0000000 0000000 00000000000 13171666371 0023743 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/ 0000775 0000000 0000000 00000000000 13171666371 0025034 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0026761 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case1/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0026772 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case1/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025374 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case1/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0026647 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case1/testcase.json 0000664 0000000 0000000 00000000231 13171666371 0026445 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-skip-tools", "-no-examples"],
["ensure", "-update"]
],
"vendor-final": [
"github.com/sdboyer/deptest"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case2/ 0000775 0000000 0000000 00000000000 13171666371 0023744 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/ 0000775 0000000 0000000 00000000000 13171666371 0025035 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0026762 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "e7725ea56516a42a641aaaf5d48754258d9f3c59949cb8a0e8a21b1ab6e07179"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0026772 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0" dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case2/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025375 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case2/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0027332 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0" dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case2/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0026650 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case2/testcase.json 0000664 0000000 0000000 00000000171 13171666371 0026451 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/ 0000775 0000000 0000000 00000000000 13171666371 0023745 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/README.md 0000664 0000000 0000000 00000000137 13171666371 0025225 0 ustar 00root root 0000000 0000000 Validate that packages imported in an ignored package are not
included in the manifest or lock. dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/ 0000775 0000000 0000000 00000000000 13171666371 0025036 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.lock 0000664 0000000 0000000 00000000661 13171666371 0026762 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "e5c16e09ed6f0a1a2b3cf472c34b7fd50861dd070e81d5e623f72e8173f0c065"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.toml 0000664 0000000 0000000 00000000166 13171666371 0027005 0 ustar 00root root 0000000 0000000 ignored = ["github.com/sdboyer/deptestdos"]
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptest"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025376 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/initial/Gopkg.lock 0000664 0000000 0000000 00000000661 13171666371 0027322 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "8114537cd7d93f5eacebdea7dfec0c3c10919d7f952d056e2a3142fee1c33aee"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/initial/Gopkg.toml 0000664 0000000 0000000 00000000166 13171666371 0027345 0 ustar 00root root 0000000 0000000 ignored = ["github.com/sdboyer/deptestdos"]
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptest"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0026651 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/initial/samples/ 0000775 0000000 0000000 00000000000 13171666371 0027042 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/initial/samples/samples.go 0000664 0000000 0000000 00000000332 13171666371 0031033 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package samples
import _ "github.com/sdboyer/deptestdos"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/empty/case3/testcase.json 0000664 0000000 0000000 00000000171 13171666371 0026452 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/ 0000775 0000000 0000000 00000000000 13171666371 0023704 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case1/ 0000775 0000000 0000000 00000000000 13171666371 0024700 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case1/final/ 0000775 0000000 0000000 00000000000 13171666371 0025771 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case1/final/Gopkg.lock 0000664 0000000 0000000 00000000436 13171666371 0027715 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case1/final/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0027723 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case1/testcase.json 0000664 0000000 0000000 00000000252 13171666371 0027405 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples", "-skip-tools"],
["ensure", "-update"]
],
"error-expected": "no dirs contained any Go code",
"vendor-final": []
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/ 0000775 0000000 0000000 00000000000 13171666371 0024701 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/final/ 0000775 0000000 0000000 00000000000 13171666371 0025772 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/final/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0027724 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/initial/ 0000775 0000000 0000000 00000000000 13171666371 0026332 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/initial/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0030264 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/initial/bar/ 0000775 0000000 0000000 00000000000 13171666371 0027076 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/initial/bar/bar.go 0000664 0000000 0000000 00000000237 13171666371 0030173 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/initial/baz/ 0000775 0000000 0000000 00000000000 13171666371 0027106 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/initial/baz/.gitignore 0000664 0000000 0000000 00000000000 13171666371 0031064 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/testcase.json 0000664 0000000 0000000 00000000157 13171666371 0027412 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure"]
],
"error-expected": "found 1 errors",
"vendor-final": []
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/ 0000775 0000000 0000000 00000000000 13171666371 0024017 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/ 0000775 0000000 0000000 00000000000 13171666371 0027071 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/final/ 0000775 0000000 0000000 00000000000 13171666371 0030162 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0032107 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
version = "v0.8.1"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "5210e61a67f6e64dabb1eb8f28df2dbeeedfca1588c102067a6ec8a35e0b15f9"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/final/Gopkg.toml 0000664 0000000 0000000 00000000174 13171666371 0032130 0 ustar 00root root 0000000 0000000 ignored = ["github.com/golang/notexist/samples*"]
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptest"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/initial/ 0000775 0000000 0000000 00000000000 13171666371 0030522 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/initial/Gopkg.lock 0000664 0000000 0000000 00000000436 13171666371 0032446 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/initial/Gopkg.toml 0000664 0000000 0000000 00000000174 13171666371 0032470 0 ustar 00root root 0000000 0000000 ignored = ["github.com/golang/notexist/samples*"]
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptest"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0031775 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/initial/samples/ 0000775 0000000 0000000 00000000000 13171666371 0032166 5 ustar 00root root 0000000 0000000 samples.go 0000664 0000000 0000000 00000000332 13171666371 0034100 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/initial/samples // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package samples
import _ "github.com/sdboyer/deptestdos"
subsamples/ 0000775 0000000 0000000 00000000000 13171666371 0034265 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/initial/samples subsamples.go 0000664 0000000 0000000 00000000333 13171666371 0036771 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/initial/samples/subsamples // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package subsamples
import _ "github.com/sdboyer/dep-test"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/stdout.txt 0000664 0000000 0000000 00000000204 13171666371 0031150 0 ustar 00root root 0000000 0000000 -CONSTRAINTS-
github.com/sdboyer/deptest
b-master
-IMPORTS/REQS-
github.com/sdboyer/deptest
-IGNORES-
-OVERRIDES-
-ANALYZER-
dep
1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-ignore/testcase.json 0000664 0000000 0000000 00000000216 13171666371 0031576 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure"],
["hash-inputs"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/ 0000775 0000000 0000000 00000000000 13171666371 0027710 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/final/ 0000775 0000000 0000000 00000000000 13171666371 0031001 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/final/Gopkg.lock 0000664 0000000 0000000 00000000436 13171666371 0032725 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "b02b7a80e20404724ba5dbffab28e772017b03800916327f58bff0da86071b6a"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/final/Gopkg.toml 0000664 0000000 0000000 00000000121 13171666371 0032737 0 ustar 00root root 0000000 0000000 ignored = ["github.com/sdboyer/deptest*", "github.com/golang/notexist/samples*"]
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/initial/ 0000775 0000000 0000000 00000000000 13171666371 0031341 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/initial/Gopkg.lock 0000664 0000000 0000000 00000000436 13171666371 0033265 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/initial/Gopkg.toml 0000664 0000000 0000000 00000000121 13171666371 0033277 0 ustar 00root root 0000000 0000000 ignored = ["github.com/sdboyer/deptest*", "github.com/golang/notexist/samples*"]
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0032614 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/initial/samples/ 0000775 0000000 0000000 00000000000 13171666371 0033005 5 ustar 00root root 0000000 0000000 samples.go 0000664 0000000 0000000 00000000332 13171666371 0034717 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/initial/samples // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package samples
import _ "github.com/sdboyer/deptestdos"
subsamples/ 0000775 0000000 0000000 00000000000 13171666371 0035104 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/initial/samples subsamples.go 0000664 0000000 0000000 00000000333 13171666371 0037610 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/initial/samples/subsamples // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package subsamples
import _ "github.com/sdboyer/dep-test"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/stdout.txt 0000664 0000000 0000000 00000000141 13171666371 0031767 0 ustar 00root root 0000000 0000000 -CONSTRAINTS-
-IMPORTS/REQS-
-IGNORES-
github.com/sdboyer/deptest*
-OVERRIDES-
-ANALYZER-
dep
1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/pkg-ignored/wildcard-other-root/testcase.json 0000664 0000000 0000000 00000000152 13171666371 0032414 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure"],
["hash-inputs"]
],
"error-expected": "",
"vendor-final": []
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/ 0000775 0000000 0000000 00000000000 13171666371 0023073 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/case1/ 0000775 0000000 0000000 00000000000 13171666371 0024067 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/case1/final/ 0000775 0000000 0000000 00000000000 13171666371 0025160 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/case1/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0027073 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/case1/final/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0027115 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0" dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/case1/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025520 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/case1/initial/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0027433 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
version = "v0.8.0"
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
packages = ["."]
[[projects]]
name = "github.com/sdboyer/deptestdos"
version = "v2.0.0"
revision = "5c607206be5decd28e6263ffffdcee067266015e"
packages = ["."]
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/case1/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0027455 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0" dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/case1/initial/main.go 0000664 0000000 0000000 00000000536 13171666371 0026777 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)
func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/case1/testcase.json 0000664 0000000 0000000 00000000307 13171666371 0026575 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-update", "github.com/sdboyer/deptest"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/ 0000775 0000000 0000000 00000000000 13171666371 0024360 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/final/ 0000775 0000000 0000000 00000000000 13171666371 0025451 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0027364 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/final/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0027406 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0" dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/final/main.go 0000664 0000000 0000000 00000000536 13171666371 0026730 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)
func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/initial/ 0000775 0000000 0000000 00000000000 13171666371 0026011 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/initial/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0027724 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
version = "v0.8.0"
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
packages = ["."]
[[projects]]
name = "github.com/sdboyer/deptestdos"
version = "v2.0.0"
revision = "5c607206be5decd28e6263ffffdcee067266015e"
packages = ["."]
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "9b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0027746 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0" dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/initial/main.go 0000664 0000000 0000000 00000000536 13171666371 0027270 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)
func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/stdout.txt 0000664 0000000 0000000 00000000115 13171666371 0026440 0 ustar 00root root 0000000 0000000 Warning: Gopkg.lock is out of sync with Gopkg.toml or the project's imports.
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/desync/testcase.json 0000664 0000000 0000000 00000000225 13171666371 0027065 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-update"]
],
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/ 0000775 0000000 0000000 00000000000 13171666371 0024046 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/lockless/ 0000775 0000000 0000000 00000000000 13171666371 0025665 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/lockless/final/ 0000775 0000000 0000000 00000000000 13171666371 0026756 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/lockless/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0030714 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/lockless/final/main.go 0000664 0000000 0000000 00000000352 13171666371 0030231 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/lockless/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027316 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/lockless/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0031254 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/lockless/initial/main.go 0000664 0000000 0000000 00000000352 13171666371 0030571 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptest"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/lockless/testcase.json 0000664 0000000 0000000 00000000246 13171666371 0030375 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-update"]
],
"error-expected": "-update works by updating the versions recorded in Gopkg.lock, but Gopkg.lock does not exist"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/nonroot-arg/ 0000775 0000000 0000000 00000000000 13171666371 0026313 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/nonroot-arg/final/ 0000775 0000000 0000000 00000000000 13171666371 0027404 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/nonroot-arg/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0031331 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/nonroot-arg/final/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0031341 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/nonroot-arg/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027744 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/nonroot-arg/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0031671 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/nonroot-arg/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0031701 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/nonroot-arg/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0031215 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
)
func main() {
_ := deptest.Map["yo yo!"]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/nonroot-arg/testcase.json 0000664 0000000 0000000 00000000316 13171666371 0031021 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-update", "github.com/sdboyer/deptest/subpkg"]
],
"error-expected": "github.com/sdboyer/deptest/subpkg is not a project root, try github.com/sdboyer/deptest instead"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/not-in-lock/ 0000775 0000000 0000000 00000000000 13171666371 0026200 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/not-in-lock/final/ 0000775 0000000 0000000 00000000000 13171666371 0027271 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/not-in-lock/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0031216 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/not-in-lock/final/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0031226 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/not-in-lock/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027631 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/not-in-lock/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0031556 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/not-in-lock/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0031566 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/not-in-lock/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0031102 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
)
func main() {
_ := deptest.Map["yo yo!"]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/not-in-lock/testcase.json 0000664 0000000 0000000 00000000272 13171666371 0030707 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-update", "github.com/sdboyer/deptesttres"]
],
"error-expected": "github.com/sdboyer/deptesttres is not present in Gopkg.lock, cannot -update it"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-constraint/ 0000775 0000000 0000000 00000000000 13171666371 0030133 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-constraint/final/ 0000775 0000000 0000000 00000000000 13171666371 0031224 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-constraint/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0033151 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-constraint/final/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0033161 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-constraint/initial/ 0000775 0000000 0000000 00000000000 13171666371 0031564 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-constraint/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0033511 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-constraint/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0033521 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-constraint/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0033035 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
)
func main() {
_ := deptest.Map["yo yo!"]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-constraint/testcase.json 0000664 0000000 0000000 00000000307 13171666371 0032641 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-update", "github.com/sdboyer/deptest:github.com/other/deptest"]
],
"error-expected": "cannot specify alternate sources on -update (github.com/other/deptest)"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-source/ 0000775 0000000 0000000 00000000000 13171666371 0027247 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-source/final/ 0000775 0000000 0000000 00000000000 13171666371 0030340 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-source/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0032265 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-source/final/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0032275 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-source/initial/ 0000775 0000000 0000000 00000000000 13171666371 0030700 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-source/initial/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0032625 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-source/initial/Gopkg.toml 0000664 0000000 0000000 00000000111 13171666371 0032635 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-source/initial/main.go 0000664 0000000 0000000 00000000404 13171666371 0032151 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
)
func main() {
_ := deptest.Map["yo yo!"]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/ensure/update/errs/spec-with-source/testcase.json 0000664 0000000 0000000 00000000332 13171666371 0031753 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure", "-update", "github.com/sdboyer/deptest@1.0.0"]
],
"error-expected": "version constraint ^1.0.0 passed for github.com/sdboyer/deptest, but -update follows constraints declared in"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/ 0000775 0000000 0000000 00000000000 13171666371 0021253 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case1/ 0000775 0000000 0000000 00000000000 13171666371 0022247 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case1/final/ 0000775 0000000 0000000 00000000000 13171666371 0023340 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.lock 0000664 0000000 0000000 00000001064 13171666371 0025262 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v0.8.0"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "a0196baa11ea047dd65037287451d36b861b00ea"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0025276 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "0.8.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case1/initial/ 0000775 0000000 0000000 00000000000 13171666371 0023700 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case1/initial/foo/ 0000775 0000000 0000000 00000000000 13171666371 0024463 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case1/initial/foo/bar.go 0000664 0000000 0000000 00000000413 13171666371 0025554 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package foo
import "github.com/sdboyer/deptest"
func Foo() deptest.Foo {
var y deptest.Foo
return y
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case1/initial/main.go 0000664 0000000 0000000 00000000523 13171666371 0025153 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/golang/notexist/foo"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
y := foo.FooFunc()
fmt.Println(x, y)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case1/testcase.json 0000664 0000000 0000000 00000000535 13171666371 0024760 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples", "-skip-tools", "-gopath"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptest": "v0.8.0",
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case2/ 0000775 0000000 0000000 00000000000 13171666371 0022250 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case2/final/ 0000775 0000000 0000000 00000000000 13171666371 0023341 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0025254 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v0.8.0"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ced51326ad990b11098d8076d0f7d72d89eee1ba6e8dacc7bc73be05cddac438"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.toml 0000664 0000000 0000000 00000000227 13171666371 0025306 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "0.8.0"
[[constraint]]
name = "github.com/sdboyer/deptestdos"
version = "2.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case2/initial/ 0000775 0000000 0000000 00000000000 13171666371 0023701 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case2/initial/foo/ 0000775 0000000 0000000 00000000000 13171666371 0024464 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case2/initial/foo/bar.go 0000664 0000000 0000000 00000000413 13171666371 0025555 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package foo
import "github.com/sdboyer/deptest"
func Foo() deptest.Foo {
var y deptest.Foo
return y
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case2/initial/main.go 0000664 0000000 0000000 00000000523 13171666371 0025154 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/golang/notexist/foo"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
y := foo.FooFunc()
fmt.Println(x, y)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case2/testcase.json 0000664 0000000 0000000 00000000414 13171666371 0024755 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples", "-skip-tools", "-gopath"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptest": "v0.8.0"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case3/ 0000775 0000000 0000000 00000000000 13171666371 0022251 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case3/final/ 0000775 0000000 0000000 00000000000 13171666371 0023342 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.lock 0000664 0000000 0000000 00000001063 13171666371 0025263 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "a0196baa11ea047dd65037287451d36b861b00ea"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "af9a783a5430dabcaaf44683c09e2b729e1c0d61f13bfdf6677c4fd0b41387ca"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0025300 0 ustar 00root root 0000000 0000000
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptest"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case3/initial/ 0000775 0000000 0000000 00000000000 13171666371 0023702 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case3/initial/foo/ 0000775 0000000 0000000 00000000000 13171666371 0024465 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case3/initial/foo/bar.go 0000664 0000000 0000000 00000000413 13171666371 0025556 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package foo
import "github.com/sdboyer/deptest"
func Foo() deptest.Foo {
var y deptest.Foo
return y
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case3/initial/main.go 0000664 0000000 0000000 00000000523 13171666371 0025155 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/golang/notexist/foo"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
y := foo.FooFunc()
fmt.Println(x, y)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case3/testcase.json 0000664 0000000 0000000 00000000461 13171666371 0024760 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples", "-skip-tools", "-gopath"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case4/ 0000775 0000000 0000000 00000000000 13171666371 0022252 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case4/final/ 0000775 0000000 0000000 00000000000 13171666371 0023343 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case4/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0025256 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "a6ba2237d28d125b55fc6c86e94e33363f1dfd880d471118d36d7587398c30b4"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case4/final/Gopkg.toml 0000664 0000000 0000000 00000000227 13171666371 0025310 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
[[constraint]]
name = "github.com/sdboyer/deptestdos"
version = "2.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case4/initial/ 0000775 0000000 0000000 00000000000 13171666371 0023703 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case4/initial/foo/ 0000775 0000000 0000000 00000000000 13171666371 0024466 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/case4/initial/foo/bar.go 0000664 0000000 0000000 00000000413 13171666371 0025557 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package foo
import "github.com/sdboyer/deptest"
func Foo() deptest.Foo {
var y deptest.Foo
return y
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case4/initial/main.go 0000664 0000000 0000000 00000000523 13171666371 0025156 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/golang/notexist/foo"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
y := foo.FooFunc()
fmt.Println(x, y)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/case4/testcase.json 0000664 0000000 0000000 00000000377 13171666371 0024767 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"]
],
"gopath-initial": {
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/ 0000775 0000000 0000000 00000000000 13171666371 0022337 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/ 0000775 0000000 0000000 00000000000 13171666371 0023333 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/README.md 0000664 0000000 0000000 00000000044 13171666371 0024610 0 ustar 00root root 0000000 0000000 Import glide config at project root. dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/final/ 0000775 0000000 0000000 00000000000 13171666371 0024424 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/final/Gopkg.lock 0000664 0000000 0000000 00000001325 13171666371 0026346 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/carolynvs/deptest-subpkg"
packages = ["subby"]
revision = "6c41d90f78bb1015696a2ad591debfa8971512d5"
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "7efcfca7f138c3579d22b4ef788294649c734ea630124fb8fbb47acf8770b086"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/final/Gopkg.toml 0000664 0000000 0000000 00000000333 13171666371 0026367 0 ustar 00root root 0000000 0000000 ignored = ["github.com/golang/notexist/samples","github.com/sdboyer/dep-test"]
[[constraint]]
name = "github.com/carolynvs/deptest-subpkg"
[[constraint]]
name = "github.com/sdboyer/deptestdos"
version = "2.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/initial/ 0000775 0000000 0000000 00000000000 13171666371 0024764 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/initial/glide.lock 0000664 0000000 0000000 00000001056 13171666371 0026724 0 ustar 00root root 0000000 0000000 hash: 16053c82a71f9bd509b05a4523df6bc418aed2083e4b8bd97a870bbc003256f8
updated: 2017-03-07T17:02:32.214383898-06:00
imports:
- name: github.com/sdboyer/deptest
repo: https://github.com/sdboyer/deptest.git
vcs: git
version: ff2948a2ac8f538c4ecd55962e919d1e13e74baf
- name: github.com/sdboyer/deptestdos
version: 5c607206be5decd28e6263ffffdcee067266015e
- name: github.com/carolynvs/deptest-subpkg/subby
version: 6c41d90f78bb1015696a2ad591debfa8971512d5
testImports:
- name: github.com/golang/lint
version: cb00e5669539f047b2f4c53a421a01b0c8e172c6
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/initial/glide.yaml 0000664 0000000 0000000 00000001047 13171666371 0026736 0 ustar 00root root 0000000 0000000 package: github.com/golang/notexist
homepage: http://example.com
license: MIT
owners:
- name: Sam Boyer
email: sdboyer@example.com
homepage: http://sdboyer.io
ignore:
- github.com/sdboyer/dep-test
excludeDirs:
- samples
import:
- package: github.com/sdboyer/deptest # This is a transitive dep and will be ignored
repo: https://github.com/sdboyer/deptest.git
vcs: git
version: v1.0.0
- package: github.com/sdboyer/deptestdos
version: v2.0.0
- package: github.com/carolynvs/deptest-subpkg/subby
testImport:
- package: github.com/golang/lint
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/initial/main.go 0000664 0000000 0000000 00000000510 13171666371 0026233 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
_ "github.com/carolynvs/deptest-subpkg/subby"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
fmt.Println(x)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/initial/samples/ 0000775 0000000 0000000 00000000000 13171666371 0026430 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/initial/samples/samples.go 0000664 0000000 0000000 00000000422 13171666371 0030421 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package samples
import dt "github.com/carolynvs/go-dep-test"
func Sample1() int {
var x = dt.Thing
return x
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case1/testcase.json 0000664 0000000 0000000 00000000633 13171666371 0026043 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples", "-gopath"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptest": "3f4c3bea144e112a69bbe5d8d01c1b09a544253f",
"github.com/sdboyer/deptestdos": "5c607206be5decd28e6263ffffdcee067266015e"
},
"vendor-final": [
"github.com/carolynvs/deptest-subpkg",
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case2/ 0000775 0000000 0000000 00000000000 13171666371 0023334 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case2/README.md 0000664 0000000 0000000 00000000072 13171666371 0024612 0 ustar 00root root 0000000 0000000 Ignore glide config at root when -skip-tools is specified. dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case2/final/ 0000775 0000000 0000000 00000000000 13171666371 0024425 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case2/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0026340 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
version = "v0.8.1"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1ed417a0bec57ffe988fae1cba8f3d49994fb893394d61844e0b3c96d69573fe"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case2/final/Gopkg.toml 0000664 0000000 0000000 00000000115 13171666371 0026366 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptestdos"
version = "2.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case2/initial/ 0000775 0000000 0000000 00000000000 13171666371 0024765 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case2/initial/glide.lock 0000664 0000000 0000000 00000000710 13171666371 0026721 0 ustar 00root root 0000000 0000000 hash: 16053c82a71f9bd509b05a4523df6bc418aed2083e4b8bd97a870bbc003256f8
updated: 2017-03-07T17:02:32.214383898-06:00
imports:
- name: github.com/sdboyer/deptest
repo: https://github.com/sdboyer/deptest.git
vcs: git
version: ff2948a2ac8f538c4ecd55962e919d1e13e74baf
- name: github.com/sdboyer/deptestdos
version: 5c607206be5decd28e6263ffffdcee067266015e
testImports:
- name: github.com/golang/lint
version: cb00e5669539f047b2f4c53a421a01b0c8e172c6
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case2/initial/glide.yaml 0000664 0000000 0000000 00000000762 13171666371 0026742 0 ustar 00root root 0000000 0000000 package: github.com/golang/notexist
homepage: http://example.com
license: MIT
owners:
- name: Sam Boyer
email: sdboyer@example.com
homepage: http://sdboyer.io
ignore:
- github.com/sdboyer/dep-test
excludeDirs:
- samples
import:
- package: github.com/sdboyer/deptest # This is a transitive dep and will be ignored
repo: https://github.com/sdboyer/deptest.git
vcs: git
version: v1.0.0
- package: github.com/sdboyer/deptestdos
version: v2.0.0
testImport:
- package: github.com/golang/lint
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case2/initial/main.go 0000664 0000000 0000000 00000000431 13171666371 0026236 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
fmt.Println(x)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case2/testcase.json 0000664 0000000 0000000 00000000577 13171666371 0026053 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples", "-skip-tools", "-gopath"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptest": "3f4c3bea144e112a69bbe5d8d01c1b09a544253f",
"github.com/sdboyer/deptestdos": "5c607206be5decd28e6263ffffdcee067266015e"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case3/ 0000775 0000000 0000000 00000000000 13171666371 0023335 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case3/README.md 0000664 0000000 0000000 00000000044 13171666371 0024612 0 ustar 00root root 0000000 0000000 Import glide config in dependencies. dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case3/final/ 0000775 0000000 0000000 00000000000 13171666371 0024426 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case3/final/Gopkg.lock 0000664 0000000 0000000 00000001124 13171666371 0026345 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/carolynvs/deptestglide"
packages = ["."]
revision = "aa7fea6e17ca281c6f210afb93fc3c98ef29a695"
version = "v0.1.1"
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
version = "v0.8.1"
[solve-meta]
analyzer-name = "dep+import"
analyzer-version = 1
inputs-digest = "07eddb7ff09071bde95b019911e1fb30d91bddabbb23f4c797c6ce61b58cd7be"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case3/final/Gopkg.toml 0000664 0000000 0000000 00000000121 13171666371 0026364 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/carolynvs/deptestglide"
version = "0.1.1"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case3/initial/ 0000775 0000000 0000000 00000000000 13171666371 0024766 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case3/initial/main.go 0000664 0000000 0000000 00000000443 13171666371 0026242 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/carolynvs/deptestglide"
)
func main() {
var x = deptestglide.MyFoo
fmt.Println(x)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/glide/case3/testcase.json.ignore 0000664 0000000 0000000 00000000310 13171666371 0027317 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"]
],
"error-expected": "",
"gopath-initial": {},
"vendor-final": [
"github.com/carolynvs/deptestglide",
"github.com/sdboyer/deptest"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/godep/ 0000775 0000000 0000000 00000000000 13171666371 0022351 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/godep/case1/ 0000775 0000000 0000000 00000000000 13171666371 0023345 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/godep/case1/final/ 0000775 0000000 0000000 00000000000 13171666371 0024436 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/godep/case1/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0026351 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
version = "v0.8.1"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1ed417a0bec57ffe988fae1cba8f3d49994fb893394d61844e0b3c96d69573fe"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/godep/case1/final/Gopkg.toml 0000664 0000000 0000000 00000000115 13171666371 0026377 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptestdos"
version = "2.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/godep/case1/initial/ 0000775 0000000 0000000 00000000000 13171666371 0024776 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/godep/case1/initial/Godeps/ 0000775 0000000 0000000 00000000000 13171666371 0026217 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/godep/case1/initial/Godeps/Godeps.json 0000664 0000000 0000000 00000000632 13171666371 0030334 0 ustar 00root root 0000000 0000000 {
"ImportPath": "github.com/golang/notexist",
"GoVersion": "go1.8",
"GodepVersion": "vXYZ",
"Deps": [
{
"ImportPath": "github.com/sdboyer/deptest",
"Comment": "master",
"Rev": "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
},
{
"ImportPath": "github.com/sdboyer/deptestdos",
"Comment": "v2.0.0",
"Rev": "5c607206be5decd28e6263ffffdcee067266015e"
}
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/godep/case1/initial/main.go 0000664 0000000 0000000 00000000431 13171666371 0026247 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
fmt.Println(x)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/godep/case1/testcase.json 0000664 0000000 0000000 00000000424 13171666371 0026053 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptest": "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/govend/ 0000775 0000000 0000000 00000000000 13171666371 0022535 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/govend/case1/ 0000775 0000000 0000000 00000000000 13171666371 0023531 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/govend/case1/final/ 0000775 0000000 0000000 00000000000 13171666371 0024622 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/govend/case1/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0026535 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
version = "v0.8.1"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1ed417a0bec57ffe988fae1cba8f3d49994fb893394d61844e0b3c96d69573fe"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/govend/case1/final/Gopkg.toml 0000664 0000000 0000000 00000000115 13171666371 0026563 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptestdos"
version = "2.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/govend/case1/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025162 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/govend/case1/initial/main.go 0000664 0000000 0000000 00000000431 13171666371 0026433 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
fmt.Println(x)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/govend/case1/initial/vendor.yml 0000664 0000000 0000000 00000000262 13171666371 0027202 0 ustar 00root root 0000000 0000000 vendors:
- path: github.com/sdboyer/deptest
rev: 3f4c3bea144e112a69bbe5d8d01c1b09a544253f
- path: github.com/sdboyer/deptestdos
rev: 5c607206be5decd28e6263ffffdcee067266015e
dep-0.3.2/cmd/dep/testdata/harness_tests/init/govend/case1/testcase.json 0000664 0000000 0000000 00000000424 13171666371 0026237 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptest": "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/gvt/ 0000775 0000000 0000000 00000000000 13171666371 0022053 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/gvt/case1/ 0000775 0000000 0000000 00000000000 13171666371 0023047 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/gvt/case1/final/ 0000775 0000000 0000000 00000000000 13171666371 0024140 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/gvt/case1/final/Gopkg.lock 0000664 0000000 0000000 00000001400 13171666371 0026054 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
source = "https://github.com/carolynvs/deptest"
version = "v0.8.1"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[[projects]]
branch = "v2"
name = "gopkg.in/yaml.v2"
packages = ["."]
revision = "f7716cbe52baa25d2e9b0d0da546fcf909fc16b4"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "9ee70d58a0bc986cfb1d57a351786e9cf1bfc2ca763ce17f601a6529aebe65d1"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/gvt/case1/final/Gopkg.toml 0000664 0000000 0000000 00000000335 13171666371 0026105 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
source = "https://github.com/carolynvs/deptest"
[[constraint]]
name = "github.com/sdboyer/deptestdos"
[[constraint]]
branch = "v2"
name = "gopkg.in/yaml.v2"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/gvt/case1/initial/ 0000775 0000000 0000000 00000000000 13171666371 0024500 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/gvt/case1/initial/main.go 0000664 0000000 0000000 00000000570 13171666371 0025755 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
"gopkg.in/yaml.v2"
)
func main() {
var a deptestdos.Bar
var b yaml.MapItem
var c deptest.Foo
fmt.Println(a, b, c)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/gvt/case1/initial/vendor/ 0000775 0000000 0000000 00000000000 13171666371 0025775 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/gvt/case1/initial/vendor/manifest 0000664 0000000 0000000 00000001216 13171666371 0027526 0 ustar 00root root 0000000 0000000 {
"version": "0",
"dependencies": [
{
"importpath": "github.com/sdboyer/deptest",
"repository": "https://github.com/carolynvs/deptest",
"revision": "3f4c3bea144e112a69bbe5d8d01c1b09a544253f",
"branch": "HEAD"
},
{
"importpath": "github.com/sdboyer/deptestdos",
"repository": "https://github.com/sdboyer/deptestdos",
"revision": "5c607206be5decd28e6263ffffdcee067266015eXXX",
"branch": "master"
},
{
"importpath": "gopkg.in/yaml.v2",
"repository": "https://gopkg.in/yaml.v2",
"revision": "f7716cbe52baa25d2e9b0d0da546fcf909fc16b4",
"branch": "v2"
}
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/gvt/case1/testcase.json 0000664 0000000 0000000 00000000424 13171666371 0025555 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptest": "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/manifest-exists/ 0000775 0000000 0000000 00000000000 13171666371 0024376 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/manifest-exists/final/ 0000775 0000000 0000000 00000000000 13171666371 0025467 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/manifest-exists/final/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0027421 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/manifest-exists/initial/ 0000775 0000000 0000000 00000000000 13171666371 0026027 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/manifest-exists/initial/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0027761 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/manifest-exists/testcase.json 0000664 0000000 0000000 00000000153 13171666371 0027103 0 ustar 00root root 0000000 0000000 {
"commands": [
["init"]
],
"error-expected": "manifest already exists:",
"vendor-final": []
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/ 0000775 0000000 0000000 00000000000 13171666371 0024102 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/final/ 0000775 0000000 0000000 00000000000 13171666371 0025173 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/final/project_dir/ 0000775 0000000 0000000 00000000000 13171666371 0027477 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/final/project_dir/Gopkg.lock 0000664 0000000 0000000 00000000673 13171666371 0031426 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
memo = "af9a783a5430dabcaaf44683c09e2b729e1c0d61f13bfdf6677c4fd0b41387ca"
[[projects]]
branch = "master"
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "a0196baa11ea047dd65037287451d36b861b00ea"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/final/project_dir/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0031435 0 ustar 00root root 0000000 0000000
[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptest"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025533 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/initial/project_dir/ 0000775 0000000 0000000 00000000000 13171666371 0030037 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/initial/project_dir/foo/ 0000775 0000000 0000000 00000000000 13171666371 0030622 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/initial/project_dir/foo/bar.go 0000664 0000000 0000000 00000000413 13171666371 0031713 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package foo
import "github.com/sdboyer/deptest"
func Foo() deptest.Foo {
var y deptest.Foo
return y
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/initial/project_dir/main.go 0000664 0000000 0000000 00000000461 13171666371 0031313 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
y := foo.FooFunc()
fmt.Println(x, y)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/relative_path/testcase.json 0000664 0000000 0000000 00000000171 13171666371 0026607 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-skip-tools", "project_dir"]
],
"error-expected": "",
"init-path": "project_dir"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/ 0000775 0000000 0000000 00000000000 13171666371 0023452 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/final/ 0000775 0000000 0000000 00000000000 13171666371 0024543 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/final/Gopkg.lock 0000664 0000000 0000000 00000000662 13171666371 0026470 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v1.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "14b07b05e0f01051b03887ab2bf80b516bc5510ea92f75f76c894b1745d8850c"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0026501 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025103 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/initial/.foo/ 0000775 0000000 0000000 00000000000 13171666371 0025744 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/initial/.foo/main.go 0000664 0000000 0000000 00000000523 13171666371 0027217 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/golang/notexist/foo"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
y := foo.FooFunc()
fmt.Println(x, y)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/initial/_foo/ 0000775 0000000 0000000 00000000000 13171666371 0026025 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/initial/_foo/main.go 0000664 0000000 0000000 00000000523 13171666371 0027300 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/golang/notexist/foo"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
y := foo.FooFunc()
fmt.Println(x, y)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/initial/lib.go 0000664 0000000 0000000 00000000413 13171666371 0026176 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package foo
import "github.com/sdboyer/deptest"
func Foo() deptest.Foo {
var y deptest.Foo
return y
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/initial/testdata/ 0000775 0000000 0000000 00000000000 13171666371 0026714 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/initial/testdata/main.go 0000664 0000000 0000000 00000000523 13171666371 0030167 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/golang/notexist/foo"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
y := foo.FooFunc()
fmt.Println(x, y)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/skip-hidden/testcase.json 0000664 0000000 0000000 00000000226 13171666371 0026160 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples", "-skip-tools"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/usage/ 0000775 0000000 0000000 00000000000 13171666371 0022357 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/usage/with_h_flag/ 0000775 0000000 0000000 00000000000 13171666371 0024632 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/usage/with_h_flag/testcase.json 0000664 0000000 0000000 00000000131 13171666371 0027333 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-h"]
],
"error-expected": "Usage: dep init [root]"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/usage/with_not_defined_flag/ 0000775 0000000 0000000 00000000000 13171666371 0026661 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/usage/with_not_defined_flag/testcase.json 0000664 0000000 0000000 00000000232 13171666371 0031364 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-not-defined-flag"]
],
"error-expected": "flag provided but not defined: -not-defined-flag\nUsage: dep init [root]"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/vndr/ 0000775 0000000 0000000 00000000000 13171666371 0022224 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/vndr/case1/ 0000775 0000000 0000000 00000000000 13171666371 0023220 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/vndr/case1/final/ 0000775 0000000 0000000 00000000000 13171666371 0024311 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/vndr/case1/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0026224 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
version = "v0.8.1"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1ed417a0bec57ffe988fae1cba8f3d49994fb893394d61844e0b3c96d69573fe"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/init/vndr/case1/final/Gopkg.toml 0000664 0000000 0000000 00000000115 13171666371 0026252 0 ustar 00root root 0000000 0000000
[[constraint]]
name = "github.com/sdboyer/deptestdos"
version = "2.0.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/init/vndr/case1/initial/ 0000775 0000000 0000000 00000000000 13171666371 0024651 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/init/vndr/case1/initial/main.go 0000664 0000000 0000000 00000000431 13171666371 0026122 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/sdboyer/deptestdos"
)
func main() {
var x deptestdos.Bar
fmt.Println(x)
}
dep-0.3.2/cmd/dep/testdata/harness_tests/init/vndr/case1/initial/vendor.conf 0000664 0000000 0000000 00000000252 13171666371 0027014 0 ustar 00root root 0000000 0000000 # Comment on its own line
github.com/sdboyer/deptest 3f4c3bea144e112a69bbe5d8d01c1b09a544253f https://github.com/sdboyer/deptest.git
github.com/sdboyer/deptestdos v2.0.0
dep-0.3.2/cmd/dep/testdata/harness_tests/init/vndr/case1/testcase.json 0000664 0000000 0000000 00000000424 13171666371 0025726 0 ustar 00root root 0000000 0000000 {
"commands": [
["init", "-no-examples"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptest": "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/prune/ 0000775 0000000 0000000 00000000000 13171666371 0021441 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/prune/without_lock/ 0000775 0000000 0000000 00000000000 13171666371 0024154 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/prune/without_lock/final/ 0000775 0000000 0000000 00000000000 13171666371 0025245 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/prune/without_lock/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0027203 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "^0.8.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/prune/without_lock/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025605 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/prune/without_lock/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0027543 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "^0.8.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/prune/without_lock/testcase.json 0000664 0000000 0000000 00000000123 13171666371 0026656 0 ustar 00root root 0000000 0000000 {
"commands": [
["prune"]
],
"error-expected": "Gopkg.lock must exist"
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/ 0000775 0000000 0000000 00000000000 13171666371 0021633 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/ 0000775 0000000 0000000 00000000000 13171666371 0022627 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/dot/ 0000775 0000000 0000000 00000000000 13171666371 0023415 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/dot/final/ 0000775 0000000 0000000 00000000000 13171666371 0024506 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/dot/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0026421 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v0.8.0"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/dot/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0026444 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "^0.8.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/dot/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025046 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/dot/initial/Gopkg.lock 0000664 0000000 0000000 00000000601 13171666371 0026764 0 ustar 00root root 0000000 0000000 memo = "9a5243dd3fa20feeaa20398e7283d6c566532e2af1aae279a010df34793761c5"
[[projects]]
name = "github.com/sdboyer/deptest"
version = "v0.8.0"
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
packages = ["."]
[[projects]]
name = "github.com/sdboyer/deptestdos"
version = "v2.0.0"
revision = "5c607206be5decd28e6263ffffdcee067266015e"
packages = ["."]
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/dot/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0027004 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "^0.8.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/dot/initial/main.go 0000664 0000000 0000000 00000000536 13171666371 0026325 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)
func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/dot/stdout.txt 0000664 0000000 0000000 00000000426 13171666371 0025502 0 ustar 00root root 0000000 0000000 digraph {
node [shape=box];
388407825 [label="github.com/golang/notexist"];
2304687900 [label="github.com/sdboyer/deptest\nv0.8.0"];
2659405890 [label="github.com/sdboyer/deptestdos\nv2.0.0"];
388407825 -> 2304687900;
388407825 -> 2659405890;
2659405890 -> 2304687900;
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/dot/testcase.json 0000664 0000000 0000000 00000000266 13171666371 0026127 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure"],
["status", "-dot"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/json/ 0000775 0000000 0000000 00000000000 13171666371 0023600 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/json/final/ 0000775 0000000 0000000 00000000000 13171666371 0024671 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/json/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0026604 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v0.8.0"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/json/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0026627 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "^0.8.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/json/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025231 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/json/initial/Gopkg.lock 0000664 0000000 0000000 00000000601 13171666371 0027147 0 ustar 00root root 0000000 0000000 memo = "9a5243dd3fa20feeaa20398e7283d6c566532e2af1aae279a010df34793761c5"
[[projects]]
name = "github.com/sdboyer/deptest"
version = "v0.8.0"
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
packages = ["."]
[[projects]]
name = "github.com/sdboyer/deptestdos"
version = "v2.0.0"
revision = "5c607206be5decd28e6263ffffdcee067266015e"
packages = ["."]
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/json/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0027167 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "^0.8.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/json/initial/main.go 0000664 0000000 0000000 00000000536 13171666371 0026510 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)
func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/json/stdout.txt 0000664 0000000 0000000 00000000642 13171666371 0025665 0 ustar 00root root 0000000 0000000 [{"ProjectRoot":"github.com/sdboyer/deptest","Constraint":"^0.8.0","Version":"v0.8.0","Revision":"ff2948a2ac8f538c4ecd55962e919d1e13e74baf","Latest":"3f4c3bea144e112a69bbe5d8d01c1b09a544253f","PackageCount":1},{"ProjectRoot":"github.com/sdboyer/deptestdos","Constraint":"*","Version":"v2.0.0","Revision":"5c607206be5decd28e6263ffffdcee067266015e","Latest":"5c607206be5decd28e6263ffffdcee067266015e","PackageCount":1}]
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/json/testcase.json 0000664 0000000 0000000 00000000267 13171666371 0026313 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure"],
["status", "-json"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/table/ 0000775 0000000 0000000 00000000000 13171666371 0023716 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/table/final/ 0000775 0000000 0000000 00000000000 13171666371 0025007 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/table/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0026722 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
version = "v0.8.0"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1b381263a360eafafe3ef7f9be626672668d17250a3c9a8debd169d1b5e2eebb"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/table/final/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0026745 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "^0.8.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/table/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025347 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/table/initial/Gopkg.lock 0000664 0000000 0000000 00000000601 13171666371 0027265 0 ustar 00root root 0000000 0000000 memo = "9a5243dd3fa20feeaa20398e7283d6c566532e2af1aae279a010df34793761c5"
[[projects]]
name = "github.com/sdboyer/deptest"
version = "v0.8.0"
revision = "ff2948a2ac8f538c4ecd55962e919d1e13e74baf"
packages = ["."]
[[projects]]
name = "github.com/sdboyer/deptestdos"
version = "v2.0.0"
revision = "5c607206be5decd28e6263ffffdcee067266015e"
packages = ["."]
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/table/initial/Gopkg.toml 0000664 0000000 0000000 00000000112 13171666371 0027305 0 ustar 00root root 0000000 0000000 [[constraint]]
name = "github.com/sdboyer/deptest"
version = "^0.8.0"
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/table/initial/main.go 0000664 0000000 0000000 00000000536 13171666371 0026626 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)
func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/table/stdout.txt 0000664 0000000 0000000 00000000346 13171666371 0026004 0 ustar 00root root 0000000 0000000 PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/sdboyer/deptest ^0.8.0 v0.8.0 ff2948a 3f4c3be 1
github.com/sdboyer/deptestdos * v2.0.0 5c60720 5c60720 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/case1/table/testcase.json 0000664 0000000 0000000 00000000256 13171666371 0026427 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure"],
["status"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/ignore_lock_mismatch/ 0000775 0000000 0000000 00000000000 13171666371 0026013 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/ignore_lock_mismatch/final/ 0000775 0000000 0000000 00000000000 13171666371 0027104 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/ignore_lock_mismatch/final/Gopkg.lock 0000664 0000000 0000000 00000000436 13171666371 0031030 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/ignore_lock_mismatch/final/Gopkg.toml 0000664 0000000 0000000 00000000055 13171666371 0031050 0 ustar 00root root 0000000 0000000 ignored = ["github.com/sdboyer/deptestdos"]
dep-0.3.2/cmd/dep/testdata/harness_tests/status/ignore_lock_mismatch/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027444 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/ignore_lock_mismatch/initial/Gopkg.lock 0000664 0000000 0000000 00000000436 13171666371 0031370 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/ignore_lock_mismatch/initial/Gopkg.toml 0000664 0000000 0000000 00000000055 13171666371 0031410 0 ustar 00root root 0000000 0000000 ignored = ["github.com/sdboyer/deptestdos"]
dep-0.3.2/cmd/dep/testdata/harness_tests/status/ignore_lock_mismatch/initial/main.go 0000664 0000000 0000000 00000000355 13171666371 0030722 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptestdos"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/ignore_lock_mismatch/testcase.json 0000664 0000000 0000000 00000000175 13171666371 0030524 0 ustar 00root root 0000000 0000000 {
"commands": [
["status"]
],
"error-expected": "This happens when Gopkg.toml is modified",
"vendor-final": []
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/missing_pkgs_lock_mismatch/ 0000775 0000000 0000000 00000000000 13171666371 0027225 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/missing_pkgs_lock_mismatch/final/ 0000775 0000000 0000000 00000000000 13171666371 0030316 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/missing_pkgs_lock_mismatch/final/Gopkg.lock 0000664 0000000 0000000 00000000436 13171666371 0032242 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/missing_pkgs_lock_mismatch/final/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0032250 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/missing_pkgs_lock_mismatch/initial/ 0000775 0000000 0000000 00000000000 13171666371 0030656 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/missing_pkgs_lock_mismatch/initial/Gopkg.lock 0000664 0000000 0000000 00000000436 13171666371 0032602 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/missing_pkgs_lock_mismatch/initial/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0032610 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/missing_pkgs_lock_mismatch/initial/main.go 0000664 0000000 0000000 00000000355 13171666371 0032134 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptestdos"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/missing_pkgs_lock_mismatch/testcase.json 0000664 0000000 0000000 00000000210 13171666371 0031724 0 ustar 00root root 0000000 0000000 {
"commands": [
["status"]
],
"error-expected": "due to the following packages missing from the lock",
"vendor-final": []
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/override_constraint/ 0000775 0000000 0000000 00000000000 13171666371 0025716 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/override_constraint/final/ 0000775 0000000 0000000 00000000000 13171666371 0027007 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/override_constraint/final/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0030722 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
version = "v0.8.1"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1c4444f47ab5d5c484634d1a0c95d99beb879a37337bc0d7aecbd97cf79b6cb1"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/override_constraint/final/Gopkg.toml 0000664 0000000 0000000 00000000110 13171666371 0030743 0 ustar 00root root 0000000 0000000 [[override]]
name = "github.com/sdboyer/deptest"
version = "=0.8.1"
dep-0.3.2/cmd/dep/testdata/harness_tests/status/override_constraint/initial/ 0000775 0000000 0000000 00000000000 13171666371 0027347 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/override_constraint/initial/Gopkg.lock 0000664 0000000 0000000 00000001111 13171666371 0031262 0 ustar 00root root 0000000 0000000 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/sdboyer/deptest"
packages = ["."]
revision = "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
version = "v0.8.1"
[[projects]]
name = "github.com/sdboyer/deptestdos"
packages = ["."]
revision = "5c607206be5decd28e6263ffffdcee067266015e"
version = "v2.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "1c4444f47ab5d5c484634d1a0c95d99beb879a37337bc0d7aecbd97cf79b6cb1"
solver-name = "gps-cdcl"
solver-version = 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/override_constraint/initial/Gopkg.toml 0000664 0000000 0000000 00000000110 13171666371 0031303 0 ustar 00root root 0000000 0000000 [[override]]
name = "github.com/sdboyer/deptest"
version = "=0.8.1"
dep-0.3.2/cmd/dep/testdata/harness_tests/status/override_constraint/initial/main.go 0000664 0000000 0000000 00000000355 13171666371 0030625 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
_ "github.com/sdboyer/deptestdos"
)
func main() {
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/override_constraint/stdout.txt 0000664 0000000 0000000 00000000351 13171666371 0030000 0 ustar 00root root 0000000 0000000 PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/sdboyer/deptest * (override) v0.8.1 3f4c3be ff2948a 1
github.com/sdboyer/deptestdos * v2.0.0 5c60720 5c60720 1
dep-0.3.2/cmd/dep/testdata/harness_tests/status/override_constraint/testcase.json 0000664 0000000 0000000 00000000256 13171666371 0030427 0 ustar 00root root 0000000 0000000 {
"commands": [
["ensure"],
["status"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}
dep-0.3.2/cmd/dep/testdata/harness_tests/status/without_lock/ 0000775 0000000 0000000 00000000000 13171666371 0024346 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/without_lock/final/ 0000775 0000000 0000000 00000000000 13171666371 0025437 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/without_lock/final/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0027371 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/without_lock/initial/ 0000775 0000000 0000000 00000000000 13171666371 0025777 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/without_lock/initial/Gopkg.toml 0000664 0000000 0000000 00000000000 13171666371 0027731 0 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/harness_tests/status/without_lock/testcase.json 0000664 0000000 0000000 00000000172 13171666371 0027054 0 ustar 00root root 0000000 0000000 {
"commands": [
["status"]
],
"error-expected": "no Gopkg.lock found. Run `dep ensure` to generate lock file"
}
dep-0.3.2/cmd/dep/testdata/init/ 0000775 0000000 0000000 00000000000 13171666371 0016366 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/init/directdeps/ 0000775 0000000 0000000 00000000000 13171666371 0020514 5 ustar 00root root 0000000 0000000 dep-0.3.2/cmd/dep/testdata/init/directdeps/main.go 0000664 0000000 0000000 00000000363 13171666371 0021771 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import _ "github.com/carolynvs/deptest-subpkg/subby"
func main() {}
dep-0.3.2/cmd/dep/version.go 0000664 0000000 0000000 00000002073 13171666371 0015630 0 ustar 00root root 0000000 0000000 // Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"flag"
"runtime"
"github.com/golang/dep"
)
var (
version = "devel"
buildDate string
commitHash string
)
const versionHelp = `Show the dep version information`
func (cmd *versionCommand) Name() string { return "version" }
func (cmd *versionCommand) Args() string {
return ""
}
func (cmd *versionCommand) ShortHelp() string { return versionHelp }
func (cmd *versionCommand) LongHelp() string { return versionHelp }
func (cmd *versionCommand) Hidden() bool { return false }
func (cmd *versionCommand) Register(fs *flag.FlagSet) {}
type versionCommand struct{}
func (cmd *versionCommand) Run(ctx *dep.Ctx, args []string) error {
ctx.Out.Printf(`dep:
version : %s
build date : %s
git hash : %s
go version : %s
go compiler : %s
platform : %s/%s
`, version, buildDate, commitHash,
runtime.Version(), runtime.Compiler, runtime.GOOS, runtime.GOARCH)
return nil
}
dep-0.3.2/context.go 0000664 0000000 0000000 00000021216 13171666371 0014314 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package dep
import (
"log"
"os"
"path/filepath"
"runtime"
"github.com/golang/dep/internal/fs"
"github.com/golang/dep/internal/gps"
"github.com/pkg/errors"
)
// Ctx defines the supporting context of dep.
//
// A properly initialized Ctx has a GOPATH containing the project root and non-nil Loggers.
//
// ctx := &dep.Ctx{
// WorkingDir: GOPATH + "/src/project/root",
// GOPATH: GOPATH,
// Out: log.New(os.Stdout, "", 0),
// Err: log.New(os.Stderr, "", 0),
// }
//
// Ctx.DetectProjectGOPATH() helps with setting the containing GOPATH.
//
// ctx.GOPATH, err := Ctx.DetectProjectGOPATH(project)
// if err != nil {
// // Could not determine which GOPATH to use for the project.
// }
//
type Ctx struct {
WorkingDir string // Where to execute.
GOPATH string // Selected Go path, containing WorkingDir.
GOPATHs []string // Other Go paths.
Out, Err *log.Logger // Required loggers.
Verbose bool // Enables more verbose logging.
DisableLocking bool // When set, no lock file will be created to protect against simultaneous dep processes.
}
// SetPaths sets the WorkingDir and GOPATHs fields. If GOPATHs is empty, then
// the GOPATH environment variable (or the default GOPATH) is used instead.
func (c *Ctx) SetPaths(wd string, GOPATHs ...string) error {
if wd == "" {
return errors.New("cannot set Ctx.WorkingDir to an empty path")
}
c.WorkingDir = wd
if len(GOPATHs) == 0 {
GOPATH := os.Getenv("GOPATH")
if GOPATH == "" {
GOPATH = defaultGOPATH()
}
GOPATHs = filepath.SplitList(GOPATH)
}
c.GOPATHs = append(c.GOPATHs, GOPATHs...)
return nil
}
// defaultGOPATH gets the default GOPATH that was added in 1.8
// copied from go/build/build.go
func defaultGOPATH() string {
env := "HOME"
if runtime.GOOS == "windows" {
env = "USERPROFILE"
} else if runtime.GOOS == "plan9" {
env = "home"
}
if home := os.Getenv(env); home != "" {
def := filepath.Join(home, "go")
if def == runtime.GOROOT() {
// Don't set the default GOPATH to GOROOT,
// as that will trigger warnings from the go tool.
return ""
}
return def
}
return ""
}
// SourceManager produces an instance of gps's built-in SourceManager
// initialized to log to the receiver's logger.
func (c *Ctx) SourceManager() (*gps.SourceMgr, error) {
return gps.NewSourceManager(gps.SourceManagerConfig{
Cachedir: filepath.Join(c.GOPATH, "pkg", "dep"),
Logger: c.Out,
DisableLocking: c.DisableLocking,
})
}
// LoadProject starts from the current working directory and searches up the
// directory tree for a project root. The search stops when a file with the name
// ManifestName (Gopkg.toml, by default) is located.
//
// The Project contains the parsed manifest as well as a parsed lock file, if
// present. The import path is calculated as the remaining path segment
// below Ctx.GOPATH/src.
func (c *Ctx) LoadProject() (*Project, error) {
root, err := findProjectRoot(c.WorkingDir)
if err != nil {
return nil, err
}
err = checkGopkgFilenames(root)
if err != nil {
return nil, err
}
p := new(Project)
if err = p.SetRoot(root); err != nil {
return nil, err
}
c.GOPATH, err = c.DetectProjectGOPATH(p)
if err != nil {
return nil, err
}
ip, err := c.ImportForAbs(p.AbsRoot)
if err != nil {
return nil, errors.Wrap(err, "root project import")
}
p.ImportRoot = gps.ProjectRoot(ip)
mp := filepath.Join(p.AbsRoot, ManifestName)
mf, err := os.Open(mp)
if err != nil {
if os.IsNotExist(err) {
// TODO: list possible solutions? (dep init, cd $project)
return nil, errors.Errorf("no %v found in project root %v", ManifestName, p.AbsRoot)
}
// Unable to read the manifest file
return nil, err
}
defer mf.Close()
var warns []error
p.Manifest, warns, err = readManifest(mf)
for _, warn := range warns {
c.Err.Printf("dep: WARNING: %v\n", warn)
}
if err != nil {
return nil, errors.Wrapf(err, "error while parsing %s", mp)
}
lp := filepath.Join(p.AbsRoot, LockName)
lf, err := os.Open(lp)
if err != nil {
if os.IsNotExist(err) {
// It's fine for the lock not to exist
return p, nil
}
// But if a lock does exist and we can't open it, that's a problem
return nil, errors.Wrapf(err, "could not open %s", lp)
}
defer lf.Close()
p.Lock, err = readLock(lf)
if err != nil {
return nil, errors.Wrapf(err, "error while parsing %s", lp)
}
return p, nil
}
// DetectProjectGOPATH attempt to find the GOPATH containing the project.
//
// If p.AbsRoot is not a symlink and is within a GOPATH, the GOPATH containing p.AbsRoot is returned.
// If p.AbsRoot is a symlink and is not within any known GOPATH, the GOPATH containing p.ResolvedAbsRoot is returned.
//
// p.AbsRoot is assumed to be a symlink if it is not the same as p.ResolvedAbsRoot.
//
// DetectProjectGOPATH will return an error in the following cases:
//
// If p.AbsRoot is not a symlink and is not within any known GOPATH.
// If neither p.AbsRoot nor p.ResolvedAbsRoot are within a known GOPATH.
// If both p.AbsRoot and p.ResolvedAbsRoot are within the same GOPATH.
// If p.AbsRoot and p.ResolvedAbsRoot are each within a different GOPATH.
func (c *Ctx) DetectProjectGOPATH(p *Project) (string, error) {
if p.AbsRoot == "" || p.ResolvedAbsRoot == "" {
return "", errors.New("project AbsRoot and ResolvedAbsRoot must be set to detect GOPATH")
}
pGOPATH, perr := c.detectGOPATH(p.AbsRoot)
// If p.AbsRoot is a not symlink, attempt to detect GOPATH for p.AbsRoot only.
if equal, _ := fs.EquivalentPaths(p.AbsRoot, p.ResolvedAbsRoot); equal {
return pGOPATH, perr
}
rGOPATH, rerr := c.detectGOPATH(p.ResolvedAbsRoot)
// If detectGOPATH() failed for both p.AbsRoot and p.ResolvedAbsRoot, then both are not within any known GOPATHs.
if perr != nil && rerr != nil {
return "", errors.Errorf("both %s and %s are not within any known GOPATH", p.AbsRoot, p.ResolvedAbsRoot)
}
// If pGOPATH equals rGOPATH, then both are within the same GOPATH.
if equal, _ := fs.EquivalentPaths(pGOPATH, rGOPATH); equal {
return "", errors.Errorf("both %s and %s are in the same GOPATH %s", p.AbsRoot, p.ResolvedAbsRoot, pGOPATH)
}
if pGOPATH != "" && rGOPATH != "" {
return "", errors.Errorf("%s and %s are both in different GOPATHs", p.AbsRoot, p.ResolvedAbsRoot)
}
// Otherwise, either the p.AbsRoot or p.ResolvedAbsRoot is within a GOPATH.
if pGOPATH == "" {
return rGOPATH, nil
}
return pGOPATH, nil
}
// detectGOPATH detects the GOPATH for a given path from ctx.GOPATHs.
func (c *Ctx) detectGOPATH(path string) (string, error) {
for _, gp := range c.GOPATHs {
isPrefix, err := fs.HasFilepathPrefix(path, gp)
if err != nil {
return "", errors.Wrap(err, "failed to detect GOPATH")
}
if isPrefix {
return gp, nil
}
}
return "", errors.Errorf("%s is not within a known GOPATH/src", path)
}
// ImportForAbs returns the import path for an absolute project path by trimming the
// `$GOPATH/src/` prefix. Returns an error for paths equal to, or without this prefix.
func (c *Ctx) ImportForAbs(path string) (string, error) {
srcprefix := filepath.Join(c.GOPATH, "src") + string(filepath.Separator)
isPrefix, err := fs.HasFilepathPrefix(path, srcprefix)
if err != nil {
return "", errors.Wrap(err, "failed to find import path")
}
if isPrefix {
if len(path) <= len(srcprefix) {
return "", errors.New("dep does not currently support using GOPATH/src as the project root")
}
// filepath.ToSlash because we're dealing with an import path now,
// not an fs path
return filepath.ToSlash(path[len(srcprefix):]), nil
}
return "", errors.Errorf("%s is not within any GOPATH/src", path)
}
// AbsForImport returns the absolute path for the project root
// including the $GOPATH. This will not work with stdlib packages and the
// package directory needs to exist.
func (c *Ctx) AbsForImport(path string) (string, error) {
posspath := filepath.Join(c.GOPATH, "src", path)
dirOK, err := fs.IsDir(posspath)
if err != nil {
return "", errors.Wrapf(err, "checking if %s is a directory", posspath)
}
if !dirOK {
return "", errors.Errorf("%s does not exist", posspath)
}
return posspath, nil
}
// ValidateParams ensure that solving can be completed with the specified params.
func (c *Ctx) ValidateParams(sm gps.SourceManager, params gps.SolveParameters) error {
err := gps.ValidateParams(params, sm)
if err != nil {
if deduceErrs, ok := err.(gps.DeductionErrs); ok {
c.Err.Println("The following errors occurred while deducing packages:")
for ip, dErr := range deduceErrs {
c.Err.Printf(" * \"%s\": %s", ip, dErr)
}
c.Err.Println()
}
}
return errors.Wrap(err, "validateParams")
}
dep-0.3.2/context_test.go 0000664 0000000 0000000 00000031653 13171666371 0015361 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package dep
import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
"unicode"
"github.com/golang/dep/internal/test"
)
func discardLogger() *log.Logger {
return log.New(ioutil.Discard, "", 0)
}
func TestCtx_ProjectImport(t *testing.T) {
h := test.NewHelper(t)
defer h.Cleanup()
h.TempDir("src")
h.Setenv("GOPATH", h.Path("."))
depCtx := &Ctx{GOPATH: h.Path(".")}
importPaths := []string{
"github.com/pkg/errors",
"my/silly/thing",
}
for _, want := range importPaths {
fullpath := filepath.Join(depCtx.GOPATH, "src", want)
h.TempDir(filepath.Join("src", want))
got, err := depCtx.ImportForAbs(fullpath)
if err != nil {
t.Fatal(err)
}
if got != want {
t.Fatalf("expected %s, got %s", want, got)
}
}
// test where it should return an error when directly within $GOPATH/src
got, err := depCtx.ImportForAbs(filepath.Join(depCtx.GOPATH, "src"))
if err == nil || !strings.Contains(err.Error(), "GOPATH/src") {
t.Fatalf("should have gotten an error for use directly in GOPATH/src, but got %s", got)
}
// test where it should return an error
got, err = depCtx.ImportForAbs("tra/la/la/la")
if err == nil {
t.Fatalf("should have gotten an error but did not for tra/la/la/la: %s", got)
}
}
func TestAbsoluteProjectRoot(t *testing.T) {
h := test.NewHelper(t)
defer h.Cleanup()
h.TempDir("src")
h.Setenv("GOPATH", h.Path("."))
depCtx := &Ctx{GOPATH: h.Path(".")}
importPaths := map[string]bool{
"github.com/pkg/errors": true,
"my/silly/thing": false,
}
for i, create := range importPaths {
if create {
h.TempDir(filepath.Join("src", i))
}
}
for i, ok := range importPaths {
got, err := depCtx.AbsForImport(i)
if ok {
h.Must(err)
want := h.Path(filepath.Join("src", i))
if got != want {
t.Fatalf("expected %s, got %q", want, got)
}
continue
}
if err == nil {
t.Fatalf("expected %s to fail", i)
}
}
// test that a file fails
h.TempFile("src/thing/thing.go", "hello world")
_, err := depCtx.AbsForImport("thing/thing.go")
if err == nil {
t.Fatal("error should not be nil for a file found")
}
}
func TestLoadProject(t *testing.T) {
h := test.NewHelper(t)
defer h.Cleanup()
h.TempDir(filepath.Join("src", "test1", "sub"))
h.TempFile(filepath.Join("src", "test1", ManifestName), "")
h.TempFile(filepath.Join("src", "test1", LockName), `memo = "cdafe8641b28cd16fe025df278b0a49b9416859345d8b6ba0ace0272b74925ee"`)
h.TempDir(filepath.Join("src", "test2", "sub"))
h.TempFile(filepath.Join("src", "test2", ManifestName), "")
var testcases = []struct {
name string
lock bool
wd string
}{
{"direct", true, filepath.Join("src", "test1")},
{"ascending", true, filepath.Join("src", "test1", "sub")},
{"without lock", false, filepath.Join("src", "test2")},
{"ascending without lock", false, filepath.Join("src", "test2", "sub")},
}
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
ctx := &Ctx{
Out: discardLogger(),
Err: discardLogger(),
}
err := ctx.SetPaths(h.Path(tc.wd), h.Path("."))
if err != nil {
t.Fatalf("%+v", err)
}
p, err := ctx.LoadProject()
switch {
case err != nil:
t.Fatalf("%s: LoadProject failed: %+v", tc.wd, err)
case p.Manifest == nil:
t.Fatalf("%s: Manifest file didn't load", tc.wd)
case tc.lock && p.Lock == nil:
t.Fatalf("%s: Lock file didn't load", tc.wd)
case !tc.lock && p.Lock != nil:
t.Fatalf("%s: Non-existent Lock file loaded", tc.wd)
}
})
}
}
func TestLoadProjectNotFoundErrors(t *testing.T) {
tg := test.NewHelper(t)
defer tg.Cleanup()
tg.TempDir("src")
tg.TempDir("src/test1")
tg.TempDir("src/test1/sub")
tg.Setenv("GOPATH", tg.Path("."))
var testcases = []struct {
lock bool
start string
path string
}{
{true, filepath.Join("src", "test1"), ""}, //direct
{true, filepath.Join("src", "test1", "sub"), ""}, //ascending
}
for _, testcase := range testcases {
ctx := &Ctx{GOPATHs: []string{tg.Path(".")}, WorkingDir: tg.Path(testcase.start)}
_, err := ctx.LoadProject()
if err == nil {
t.Errorf("%s: should have returned 'No Manifest Found' error", testcase.start)
}
}
}
func TestLoadProjectManifestParseError(t *testing.T) {
tg := test.NewHelper(t)
defer tg.Cleanup()
tg.TempDir("src")
tg.TempDir("src/test1")
tg.TempFile(filepath.Join("src/test1", ManifestName), `[[constraint]]`)
tg.TempFile(filepath.Join("src/test1", LockName), `memo = "cdafe8641b28cd16fe025df278b0a49b9416859345d8b6ba0ace0272b74925ee"\n\n[[projects]]`)
tg.Setenv("GOPATH", tg.Path("."))
path := filepath.Join("src", "test1")
tg.Cd(tg.Path(path))
wd, err := os.Getwd()
if err != nil {
t.Fatal("failed to get working directory", err)
}
ctx := &Ctx{
GOPATH: tg.Path("."),
WorkingDir: wd,
Out: discardLogger(),
Err: discardLogger(),
}
_, err = ctx.LoadProject()
if err == nil {
t.Fatal("should have returned 'Manifest Syntax' error")
}
}
func TestLoadProjectLockParseError(t *testing.T) {
tg := test.NewHelper(t)
defer tg.Cleanup()
tg.TempDir("src")
tg.TempDir("src/test1")
tg.TempFile(filepath.Join("src/test1", ManifestName), `[[constraint]]`)
tg.TempFile(filepath.Join("src/test1", LockName), `memo = "cdafe8641b28cd16fe025df278b0a49b9416859345d8b6ba0ace0272b74925ee"\n\n[[projects]]`)
tg.Setenv("GOPATH", tg.Path("."))
path := filepath.Join("src", "test1")
tg.Cd(tg.Path(path))
wd, err := os.Getwd()
if err != nil {
t.Fatal("failed to get working directory", err)
}
ctx := &Ctx{
GOPATH: tg.Path("."),
WorkingDir: wd,
Out: discardLogger(),
Err: discardLogger(),
}
_, err = ctx.LoadProject()
if err == nil {
t.Fatal("should have returned 'Lock Syntax' error")
}
}
func TestLoadProjectNoSrcDir(t *testing.T) {
tg := test.NewHelper(t)
defer tg.Cleanup()
tg.TempDir("test1")
tg.TempFile(filepath.Join("test1", ManifestName), `[[constraint]]`)
tg.TempFile(filepath.Join("test1", LockName), `memo = "cdafe8641b28cd16fe025df278b0a49b9416859345d8b6ba0ace0272b74925ee"\n\n[[projects]]`)
tg.Setenv("GOPATH", tg.Path("."))
ctx := &Ctx{GOPATH: tg.Path(".")}
path := filepath.Join("test1")
tg.Cd(tg.Path(path))
f, _ := os.OpenFile(filepath.Join(ctx.GOPATH, "src", "test1", LockName), os.O_WRONLY, os.ModePerm)
defer f.Close()
_, err := ctx.LoadProject()
if err == nil {
t.Fatal("should have returned 'Split Absolute Root' error (no 'src' dir present)")
}
}
func TestLoadProjectGopkgFilenames(t *testing.T) {
// We are trying to skip this test on file systems which are case-sensiive. We could
// have used `fs.IsCaseSensitiveFilesystem` for this check. However, the code we are
// testing also relies on `fs.IsCaseSensitiveFilesystem`. So a bug in
// `fs.IsCaseSensitiveFilesystem` could prevent this test from being run. This is the
// only scenario where we prefer the OS heuristic over doing the actual work of
// validating filesystem case sensitivity via `fs.IsCaseSensitiveFilesystem`.
if runtime.GOOS != "windows" && runtime.GOOS != "darwin" {
t.Skip("skip this test on non-Windows, non-macOS")
}
// Here we test that a manifest filename with incorrect case throws an error. Similar
// error will also be thrown for the lock file as well which has been tested in
// `project_test.go#TestCheckGopkgFilenames`. So not repeating here.
h := test.NewHelper(t)
defer h.Cleanup()
invalidMfName := strings.ToLower(ManifestName)
wd := filepath.Join("src", "test")
h.TempFile(filepath.Join(wd, invalidMfName), "")
ctx := &Ctx{
Out: discardLogger(),
Err: discardLogger(),
}
err := ctx.SetPaths(h.Path(wd), h.Path("."))
if err != nil {
t.Fatalf("%+v", err)
}
_, err = ctx.LoadProject()
if err == nil {
t.Fatal("should have returned 'Manifest Filename' error")
}
expectedErrMsg := fmt.Sprintf(
"manifest filename %q does not match %q",
invalidMfName, ManifestName,
)
if err.Error() != expectedErrMsg {
t.Fatalf("unexpected error: %+v", err)
}
}
// TestCaseInsentitive is test for Windows. This should work even though set
// difference letter cases in GOPATH.
func TestCaseInsentitiveGOPATH(t *testing.T) {
if runtime.GOOS != "windows" {
t.Skip("skip this test on non-Windows")
}
h := test.NewHelper(t)
defer h.Cleanup()
h.TempDir("src")
h.TempDir("src/test1")
h.TempFile(filepath.Join("src/test1", ManifestName), `[[constraint]]`)
// Shuffle letter case
rs := []rune(strings.ToLower(h.Path(".")))
for i, r := range rs {
if unicode.IsLower(r) {
rs[i] = unicode.ToUpper(r)
} else {
rs[i] = unicode.ToLower(r)
}
}
gopath := string(rs)
h.Setenv("GOPATH", gopath)
wd := h.Path("src/test1")
depCtx := &Ctx{}
if err := depCtx.SetPaths(wd, gopath); err != nil {
t.Fatal(err)
}
if _, err := depCtx.LoadProject(); err != nil {
t.Fatal(err)
}
ip := "github.com/pkg/errors"
fullpath := filepath.Join(depCtx.GOPATH, "src", ip)
h.TempDir(filepath.Join("src", ip))
pr, err := depCtx.ImportForAbs(fullpath)
if err != nil {
t.Fatal(err)
}
if pr != ip {
t.Fatalf("expected %s, got %s", ip, pr)
}
}
func TestDetectProjectGOPATH(t *testing.T) {
h := test.NewHelper(t)
defer h.Cleanup()
h.TempDir(filepath.Join("sym", "symlink"))
h.TempDir(filepath.Join("go", "src", "sym", "path"))
h.TempDir(filepath.Join("go", "src", "real", "path"))
h.TempDir(filepath.Join("go-two", "src", "real", "path"))
h.TempDir(filepath.Join("go-two", "src", "sym"))
ctx := &Ctx{
GOPATHs: []string{h.Path("go"), h.Path("go-two")},
}
testcases := []struct {
name string
root string
resolvedRoot string
GOPATH string
expectErr bool
}{
{
name: "project-with-no-AbsRoot",
root: "",
resolvedRoot: filepath.Join(ctx.GOPATHs[0], "src", "real", "path"),
expectErr: true,
},
{
name: "project-with-no-ResolvedAbsRoot",
root: filepath.Join(ctx.GOPATHs[0], "src", "real", "path"),
resolvedRoot: "",
expectErr: true,
},
{
name: "AbsRoot-is-not-within-any-GOPATH",
root: filepath.Join(h.Path("."), "src", "real", "path"),
resolvedRoot: filepath.Join(h.Path("."), "src", "real", "path"),
expectErr: true,
},
{
name: "neither-AbsRoot-nor-ResolvedAbsRoot-are-in-any-GOPATH",
root: filepath.Join(h.Path("."), "src", "sym", "path"),
resolvedRoot: filepath.Join(h.Path("."), "src", "real", "path"),
expectErr: true,
},
{
name: "both-AbsRoot-and-ResolvedAbsRoot-are-in-the-same-GOPATH",
root: filepath.Join(ctx.GOPATHs[0], "src", "sym", "path"),
resolvedRoot: filepath.Join(ctx.GOPATHs[0], "src", "real", "path"),
expectErr: true,
},
{
name: "AbsRoot-and-ResolvedAbsRoot-are-each-within-a-different-GOPATH",
root: filepath.Join(ctx.GOPATHs[0], "src", "sym", "path"),
resolvedRoot: filepath.Join(ctx.GOPATHs[1], "src", "real", "path"),
expectErr: true,
},
{
name: "AbsRoot-is-not-a-symlink",
root: filepath.Join(ctx.GOPATHs[0], "src", "real", "path"),
resolvedRoot: filepath.Join(ctx.GOPATHs[0], "src", "real", "path"),
GOPATH: ctx.GOPATHs[0],
},
{
name: "AbsRoot-is-a-symlink-to-ResolvedAbsRoot",
root: filepath.Join(h.Path("."), "sym", "symlink"),
resolvedRoot: filepath.Join(ctx.GOPATHs[0], "src", "real", "path"),
GOPATH: ctx.GOPATHs[0],
},
}
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
project := &Project{
AbsRoot: tc.root,
ResolvedAbsRoot: tc.resolvedRoot,
}
GOPATH, err := ctx.DetectProjectGOPATH(project)
if !tc.expectErr && err != nil {
t.Fatalf("%+v", err)
} else if tc.expectErr && err == nil {
t.Fatalf("expected an error, got nil and gopath %s", GOPATH)
}
if GOPATH != tc.GOPATH {
t.Errorf("expected GOPATH %s, got %s", tc.GOPATH, GOPATH)
}
})
}
}
func TestDetectGOPATH(t *testing.T) {
th := test.NewHelper(t)
defer th.Cleanup()
th.TempDir(filepath.Join("code", "src", "github.com", "username", "package"))
th.TempDir(filepath.Join("go", "src", "github.com", "username", "package"))
th.TempDir(filepath.Join("gotwo", "src", "github.com", "username", "package"))
ctx := &Ctx{GOPATHs: []string{
th.Path("go"),
th.Path("gotwo"),
}}
testcases := []struct {
GOPATH string
path string
err bool
}{
{th.Path("go"), th.Path(filepath.Join("go", "src", "github.com", "username", "package")), false},
{th.Path("go"), th.Path(filepath.Join("go", "src", "github.com", "username", "package")), false},
{th.Path("gotwo"), th.Path(filepath.Join("gotwo", "src", "github.com", "username", "package")), false},
{"", th.Path(filepath.Join("code", "src", "github.com", "username", "package")), true},
}
for _, tc := range testcases {
GOPATH, err := ctx.detectGOPATH(tc.path)
if tc.err && err == nil {
t.Error("expected error but got none")
}
if GOPATH != tc.GOPATH {
t.Errorf("expected GOPATH to be %s, got %s", GOPATH, tc.GOPATH)
}
}
}
dep-0.3.2/doc.go 0000664 0000000 0000000 00000000351 13171666371 0013372 0 ustar 00root root 0000000 0000000 // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package dep is a prototype dependency management library.
package dep
dep-0.3.2/docs/ 0000775 0000000 0000000 00000000000 13171666371 0013227 5 ustar 00root root 0000000 0000000 dep-0.3.2/docs/FAQ.md 0000664 0000000 0000000 00000062307 13171666371 0014170 0 ustar 00root root 0000000 0000000 # FAQ
_The first rule of FAQ is don't bikeshed the FAQ, leave that for
[Create structure for managing docs](https://github.com/golang/dep/issues/331)._
Please contribute to the FAQ! Found an explanation in an issue or pull request helpful?
Summarize the question and quote the reply, linking back to the original comment.
## Concepts
* [Does `dep` replace `go get`?](#does-dep-replace-go-get)
* [Why is it `dep ensure` instead of `dep install`?](#why-is-it-dep-ensure-instead-of-dep-install)
* [What is a direct or transitive dependency?](#what-is-a-direct-or-transitive-dependency)
## Configuration
* [What is the difference between Gopkg.toml (the "manifest") and Gopkg.lock (the "lock")?](#what-is-the-difference-between-gopkgtoml-the-manifest-and-gopkglock-the-lock)
* [How do I constrain a transitive dependency's version?](#how-do-i-constrain-a-transitive-dependencys-version)
* [Can I put the manifest and lock in the vendor directory?](#can-i-put-the-manifest-and-lock-in-the-vendor-directory)
* [How do I get `dep` to authenticate to a `git` repo?](#how-do-i-get-dep-to-authenticate-to-a-git-repo)
* [How do I get `dep` to consume private `git` repos using a Github Token?](#how-do-i-get-dep-to-consume-private-git-repos-using-a-github-token)
## Behavior
* [How does `dep` decide what version of a dependency to use?](#how-does-dep-decide-what-version-of-a-dependency-to-use)
* [What external tools are supported?](#what-external-tools-are-supported)
* [Why is `dep` ignoring a version constraint in the manifest?](#why-is-dep-ignoring-a-version-constraint-in-the-manifest)
* [Why did `dep` use a different revision for package X instead of the revision in the lock file?](#why-did-dep-use-a-different-revision-for-package-x-instead-of-the-revision-in-the-lock-file)
* [Why is `dep` slow?](#why-is-dep-slow)
* [How does `dep` handle symbolic links?](#how-does-dep-handle-symbolic-links)
* [Does `dep` support relative imports?](#does-dep-support-relative-imports)
* [How do I make `dep` resolve dependencies from my `GOPATH`?](#how-do-i-make-dep-resolve-dependencies-from-my-gopath)
* [Will `dep` let me use git submodules to store dependencies in `vendor`?](#will-dep-let-me-use-git-submodules-to-store-dependencies-in-vendor)
## Best Practices
* [Should I commit my vendor directory?](#should-i-commit-my-vendor-directory)
* [How do I roll releases that `dep` will be able to use?](#how-do-i-roll-releases-that-dep-will-be-able-to-use)
* [What semver version should I use?](#what-semver-version-should-i-use)
* [Is it OK to make backwards-incompatible changes now?](#is-it-ok-to-make-backwards-incompatible-changes-now)
* [My dependers don't use `dep` yet. What should I do?](#my-dependers-dont-use-dep-yet-what-should-i-do)
* [How do I configure a dependency that doesn't tag its releases?](#how-do-i-configure-a-dependency-that-doesnt-tag-its-releases)
* [How do I use `dep` with Docker?](#how-do-i-use-dep-with-docker)
## Concepts
### Does `dep` replace `go get`?
No. `dep` and `go get` serve mostly different purposes.
Here are some suggestions for when you could use `dep` or `go get`:
> I would say that dep doesn't replace go get, but they both can do similar things. Here's how I use them:
>
> `go get`: I want to download the source code for a go project so that I can work on it myself, or to install a tool. This clones the repo under GOPATH for all to use.
>
> `dep ensure`: I have imported a new dependency in my code and want to download the dependency so I can start using it. My workflow is "add the import to the code, and then run dep ensure so that the manifest/lock/vendor are updated". This clones the repo under my project's vendor directory, and remembers the revision used so that everyone who works on my project is guaranteed to be using the same version of dependencies.
>
> [@carolynvs in #376](https://github.com/golang/dep/issues/376#issuecomment-293964655)
> The long term vision is a sane, overall-consistent go tool. My general take is that `go get`
> is for people consuming Go code, and dep-family commands are for people developing it.
>
> [@sdboyer in #376](https://github.com/golang/dep/issues/376#issuecomment-294045873)
### Why is it `dep ensure` instead of `dep install`?
> Yeah, we went round and round on names. [A lot](https://gist.github.com/jessfraz/315db91b272441f510e81e449f675a8b).
>
> The idea of "ensure" is roughly, "ensure that all my local states - code tree, manifest, lock, and vendor - are in sync with each other." When arguments are passed, it becomes "ensure this argument is satisfied, along with synchronization between all my local states."
>
> We opted for this approach because we came to the conclusion that allowing the tool to perform partial work/exit in intermediate states ended up creating a tool that had more commands, had far more possible valid exit and input states, and was generally full of footguns. In this approach, the user has most of the same ultimate control, but exercises it differently (by modifying the code/manifest and re-running dep ensure).
>
> [@sdboyer in #371](https://github.com/golang/dep/issues/371#issuecomment-293246832)
### What is a direct or transitive dependency?
* Direct dependencies are dependencies that are imported directly by your project: they appear in at least one import statement from your project.
* Transitive dependencies are the dependencies of your dependencies. Necessary to compile but are not directly used by your code.
## Configuration
### What is the difference between `Gopkg.toml` (the "manifest") and `Gopkg.lock` (the "lock")?
> The manifest describes user intent, and the lock describes computed outputs. There's flexibility in manifests that isn't present in locks..., as the "branch": "master" constraint will match whatever revision master HAPPENS to be at right now, whereas the lock is nailed down to a specific revision.
>
> This flexibility is important because it allows us to provide easy commands (e.g. `dep ensure -update`) that can manage an update process for you, within the constraints you specify, AND because it allows your project, when imported by someone else, to collaboratively specify the constraints for your own dependencies.
>
> [@sdboyer in #281](https://github.com/golang/dep/issues/281#issuecomment-284118314)
## How do I constrain a transitive dependency's version?
First, if you're wondering about this because you're trying to keep the version
of the transitive dependency from changing, then you're working against `dep`'s
design. The lock file, `Gopkg.lock`, will keep the selected version of the
transitive dependency stable, unless you explicitly request an upgrade or it's
impossible to find a solution without changing that version.
If that isn't your use case and you still need to constrain a transitive
dependency, you have a couple of options:
1. Make the transitive dependency a direct one, either with a dummy import or an entry in the `required` list in `Gopkg.toml`.
2. Use an override.
Overrides are a sledgehammer, and should only be used as a last resort. While
constraints and overrides are declared in the same way in `Gopkg.toml`, they
behave differently:
* Constraints:
1. Can be declared by any project's manifest, yours or a dependency
2. Apply only to direct dependencies of the project declaring the constraint
3. Must not conflict with the `constraint` entries declared in any other project's manifest
* Overrides:
1. Are only utilized from the current/your project's manifest
2. Apply globally, to direct and transitive dependencies
3. Supersede constraints declared in all manifests, yours or a dependency's
Overrides are also discussed with some visuals in [the gps docs](https://github.com/sdboyer/gps/wiki/gps-for-Implementors#overrides).
## Can I put the manifest and lock in the vendor directory?
No.
> Placing these files inside `vendor/` would concretely bind us to `vendor/` in the long term.
> We prefer to treat the `vendor/` as an implementation detail.
>
> [@sdboyer on go package management list](https://groups.google.com/d/msg/go-package-management/et1qFUjrkP4/LQFCHP4WBQAJ)
## How do I get dep to authenticate to a git repo?
`dep` currently uses the `git` command under the hood, so configuring the credentials
for each repository you wish to authenticate to will allow `dep` to use an
authenticated repository.
First, configure `git` to use the credentials option for the specific repository.
For example, if you use gitlab, and you wish to access `https://gitlab.example.com/example/package.git`,
then you would want to use the following configuration:
```
$ git config --global credential.https://gitlab.example.com.example yourusername
```
In the example the hostname `gitlab.example.com.username` string seems incorrect, but
it's actually the hostname plus the name of the repo you are accessing which is `username`.
The trailing 'yourusername' is the username you would use for the actual authentication.
You also need to configure `git` with the authentication provider you wish to use. You can get
a list of providers, with the command:
```
$ git help -a | grep credential-
credential-cache remote-fd
credential-cache--daemon remote-ftp
credential-osxkeychain remote-ftps
credential-store remote-http
```
You would then choose an appropriate provider. For example, to use the osxkeychain, you
would use the following:
```
git config --global credential.helper osxkeychain
```
If you need to do this for a CI system, then you may want to use the "store" provider.
Please see the documentation on how to configure that: https://git-scm.com/docs/git-credential-store
After configuring `git`, you may need to use `git` manually once to have it store the
credentials. Once you've checked out the repo manually, it will then use the stored
credentials. This at least appears to be the behavior for the osxkeychain provider.
### How do I get dep to consume private git repos using a Github Token?
Another alternative to make `dep` work with private repos is to use a [Personal Github
Token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
and configure it inside the [`.netrc` file](https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html)
as the following example:
```
machine github.com
login [YOUR_GITHUB_TOKEN]
```
Once you have set that up, dep will automatically use that Token to authenticate to the repositories.
## Behavior
### How does `dep` decide what version of a dependency to use?
The full algorithm is complex, but the most important thing to understand is
that `dep` tries versions in a [certain
order](https://godoc.org/github.com/golang/dep/internal/gps#SortForUpgrade),
checking to see a version is acceptable according to specified constraints.
- All semver versions come first, and sort mostly according to the semver 2.0
spec, with one exception:
- Semver versions with a prerelease are sorted after *all* non-prerelease
semver. Within this subset they are sorted first by their numerical
component, then lexicographically by their prerelease version.
- The default branch(es) are next; the semantics of what "default branch" means
are specific to the underlying source type, but this is generally what you'd
get from a `go get`.
- All other branches come next, sorted lexicographically.
- All non-semver versions (tags) are next, sorted lexicographically.
- Revisions, if any, are last, sorted lexicographically. Revisions do not
typically appear in version lists, so the only invariant we maintain is
determinism - deeper semantics, like chronology or topology, do not matter.
So, given a slice of the following versions:
- Branch: `master` `devel`
- Semver tags: `v1.0.0` `v1.1.0` `v1.1.0-alpha1`
- Non-semver tags: `footag`
- Revision: `f6e74e8d`
Sorting for upgrade will result in the following slice.
`[v1.1.0 v1.0.0 v1.1.0-alpha1 footag devel master f6e74e8d]`
There are a number of factors that can eliminate a version from consideration,
the simplest of which is that it doesn't match a constraint. But if you're
trying to figure out why `dep` is doing what it does, understanding that its
basic action is to attempt versions in this order should help you to reason
about what's going on.
## What external tools are supported?
During `dep init` configuration from other dependency managers is detected
and imported, unless `-skip-tools` is specified.
The following tools are supported: `glide`, `godep`, `vndr`, `govend`, `gb` and `gvt`.
See [#186](https://github.com/golang/dep/issues/186#issuecomment-306363441) for
how to add support for another tool.
## Why is `dep` ignoring a version constraint in the manifest?
Only your project's directly imported dependencies are affected by a `constraint` entry
in the manifest. Transitive dependencies are unaffected. See [How do I constrain a transitive dependency's version](#how-do-i-constrain-a-transitive-dependencys-version)?
## Why did `dep` use a different revision for package X instead of the revision in the lock file?
Sometimes the revision specified in the lock file is no longer valid. There are a few
ways this can occur:
* When you generated the lock file, you had an unpushed commit in your local copy of package X's repository in your `GOPATH`. (This case will be going away soon)
* After generating the lock file, new commits were force pushed to package X's repository, causing the commit revision in your lock file to no longer exist.
To troubleshoot, you can revert dep's changes to your lock, and then run `dep ensure -v -n`.
This retries the command in dry-run mode with verbose logs enabled. Check the output
for a warning like the one below, indicating that a commit in the lock is no longer valid.
```
Unable to update checked out version: fatal: reference is not a tree: 4dfc6a8a7e15229398c0a018b6d7a078cccae9c8
```
> The lock file represents a set of precise, typically immutable versions for the entire transitive closure of dependencies for a project. But "the project" can be, and is, decomposed into just a bunch of arguments to an algorithm. When those inputs change, the lock may need to change as well.
>
> Under most circumstances, if those arguments don't change, then the lock remains fine and correct. You've hit one one of the few cases where that guarantee doesn't apply. The fact that you ran dep ensure and it DID a solve is a product of some arguments changing; that solving failed because this particular commit had become stale is a separate problem.
>
> [@sdboyer in #405](https://github.com/golang/dep/issues/405#issuecomment-295998489)
## Why is `dep` slow?
There are two things that really slow `dep` down. One is unavoidable; for the other, we have a plan.
The unavoidable part is the initial clone. `dep` relies on a cache of local
repositories (stored under `$GOPATH/pkg/dep`), which is populated on demand.
Unfortunately, the first `dep` run, especially for a large project, may take a
while, as all dependencies are cloned into the cache.
Fortunately, this is just an _initial_ clone - pay it once, and you're done.
The problem repeats itself a bit when you're running `dep` for the first time
in a while and there's new changesets to fetch, but even then, these costs are
only paid once per changeset.
The other part is the work of retrieving information about dependencies. There are three parts to this:
1. Getting an up-to-date list of versions from the upstream source
2. Reading the `Gopkg.toml` for a particular version out of the local cache
3. Parsing the tree of packages for import statements at a particular version
The first requires one or more network calls; the second two usually mean
something like a `git checkout`, and the third is a filesystem walk, plus
loading and parsing `.go` files. All of these are expensive operations.
Fortunately, we can cache the second and third. And that cache can be permanent
when keyed on an immutable identifier for the version - like a git commit SHA1
hash. The first is a bit trickier, but there are reasonable staleness tradeoffs
we can consider to avoid the network entirely. There's an issue to [implement
persistent caching](https://github.com/golang/dep/issues/431) that's the
gateway to all of these improvements.
There's another major performance issue that's much harder - the process of picking versions itself is an NP-complete problem in `dep`'s current design. This is a much trickier problem 😜
## How does `dep` handle symbolic links?
> because we're not crazy people who delight in inviting chaos into our lives, we need to work within one `GOPATH` at a time.
-[@sdboyer in #247](https://github.com/golang/dep/pull/247#issuecomment-284181879)
Out of convenience, one might create a symlink to a directory within their `GOPATH/src`, e.g. `ln -s ~/go/src/github.com/user/awesome-project ~/Code/awesome-project`.
When `dep` is invoked with a project root that is a symlink, it will be resolved according to the following rules:
- If the symlink is outside `GOPATH` and links to a directory within a `GOPATH`, or vice versa, then `dep` will choose whichever path is within `GOPATH`.
- If the symlink is within a `GOPATH` and the resolved path is within a *different* `GOPATH`, then an error is thrown.
- If both the symlink and the resolved path are in the same `GOPATH`, then an error is thrown.
- If neither the symlink nor the resolved path are in a `GOPATH`, then an error is thrown.
This is the only symbolic link support that `dep` really intends to provide. In keeping with the general practices of the `go` tool, `dep` tends to either ignore symlinks (when walking) or copy the symlink itself, depending on the filesystem operation being performed.
## Does `dep` support relative imports?
No.
> dep simply doesn't allow relative imports. this is one of the few places where we restrict a case that the toolchain itself allows. we disallow them only because:
>
> * the toolchain already frowns heavily on them
> * it's worse for our case, as we start venturing into [dot dot hell](http://doc.cat-v.org/plan_9/4th_edition/papers/lexnames) territory when trying to prove that the import does not escape the tree of the project
>
> [@sdboyer in #899](https://github.com/golang/dep/issues/899#issuecomment-317904001)
For a refresher on Go's recommended workspace organization, see the ["How To Write Go Code"](https://golang.org/doc/code.html) article in the Go docs. Organizing your code this way gives you a unique import path for every package.
## How do I make `dep` resolve dependencies from my `GOPATH`?
`dep init` provides an option to scan the `GOPATH` for dependencies by doing
`dep init -gopath`, which falls back to network mode when the packages are not
found in `GOPATH`. `dep ensure` doesn't work with projects in `GOPATH`.
## Will `dep` let me use git submodules to store dependencies in `vendor`?
No, with just one tiny exception: `dep` preserves `/vendor/.git`, if it exists. This was added at [cockroachdb](https://github.com/cockroachdb/cockroach)'s request, who rely on it to keep `vendor` from bloating their primary repository.
The reasons why git submodules will not be a part of dep are best expressed as a pro/con list:
**Pros**
* git submodules provide a well-structured way of nesting repositories within repositories.
**Cons**
* The nesting that git submodules perform is no more powerful or expressive than what dep already does, but dep does it both more generally (for bzr and hg) and more domain-specifically (e.g. elimination of nested vendor directories).
* Incorporating git submodules in any way would new fork new paths in the logic to handle the submodule cases, meaning nontrivial complexity increases.
* dep does not currently know or care if the project it operates on is under version control. Relying on submodules would entail that dep start paying attention to that. That it would only be conditionally does not make it better - again, more forking paths in the logic, more complexity.
* Incorporating submodules in a way that is at all visible to the user (and why else would you do it?) makes dep's workflows both more complicated and less predictable: _sometimes_ submodule-related actions are expected; _sometimes_ submodule-derived workflows are sufficient.
* Nesting one repository within another implies that changes could, potentially, be made directly in that subrepository. This is directly contrary to dep's foundational principle that `vendor` is dead code, and directly modifying anything in there is an error.
## Best Practices
### Should I commit my vendor directory?
It's up to you:
**Pros**
- It's the only way to get truly reproducible builds, as it guards against upstream renames,
deletes and commit history overwrites.
- You don't need an extra `dep ensure` step to sync `vendor/` with Gopkg.lock after most operations,
such as `go get`, cloning, getting latest, merging, etc.
**Cons**
- Your repo will be bigger, potentially a lot bigger,
though `dep prune` can help minimize this problem.
- PR diffs will include changes for files under `vendor/` when Gopkg.lock is modified,
however files in `vendor/` are [hidden by default](https://github.com/github/linguist/blob/v5.2.0/lib/linguist/generated.rb#L328) on Github.
## How do I roll releases that `dep` will be able to use?
In short: make sure you've committed your `Gopkg.toml` and `Gopkg.lock`, then
just create a tag in your version control system and push it to the canonical
location. `dep` is designed to work automatically with this sort of metadata
from `git`, `bzr`, and `hg`.
It's strongly preferred that you use [semver](http://semver.org)-compliant tag
names. We hope to develop documentation soon that describes this more precisely,
but in the meantime, the [npm](https://docs.npmjs.com/misc/semver) docs match
our patterns pretty well.
## What semver version should I use?
This can be a nuanced question, and the community is going to have to work out
some accepted standards for how semver should be applied to Go projects. At the
highest level, though, these are the rules:
* Below `v1.0.0`, anything goes. Use these releases to figure out what you want
your API to be.
* Above `v1.0.0`, the general Go best practices continue to apply - don't make
backwards-incompatible changes - exported identifiers can be added to, but
not changed or removed.
* If you must make a backwards-incompatible change, then bump the major version.
It's important to note that having a `v1.0.0` does not preclude you from having
alpha/beta/etc releases. The semver spec allows for [prerelease
versions](http://semver.org/#spec-item-9), and `dep` is careful to _not_ allow
such versions unless `Gopkg.toml` contains a range constraint that explicitly
includes prereleases: if there exists a version `v1.0.1-alpha4`, then the
constraint `>=1.0.0` will not match it, but `>=1.0.1-alpha1` will.
Some work has been done towards [a tool
to](https://github.com/bradleyfalzon/apicompat) that will analyze and compare
your code with the last release, and suggest the next version you should use.
## Is it OK to make backwards-incompatible changes now?
Yes. But.
`dep` will make it possible for the Go ecosystem to handle
backwards-incompatible changes more gracefully. However, `dep` is not some
magical panacea. Version and dependency management is hard, and dependency hell
is real. The longstanding community wisdom about avoiding breaking changes
remains important. Any `v1.0.0` release should be accompanied by a plan for how
to avoid future breaking API changes.
One good strategy may be to add to your API instead of changing it, deprecating
old versions as you progress. Then, when the time is right, you can roll a new
major version and clean out a bunch of deprecated symbols all at once.
Note that providing an incremental migration path across breaking changes (i.e.,
shims) is tricky, and something we [don't have a good answer for
yet](https://groups.google.com/forum/#!topic/go-package-management/fp2uBMf6kq4).
## My dependers don't use `dep` yet. What should I do?
For the most part, you needn't do anything differently.
The only possible issue is if your project is ever consumed as a library. If
so, then you may want to be wary about committing your `vendor/` directory, as
it can [cause
problems](https://groups.google.com/d/msg/golang-nuts/AnMr9NL6dtc/UnyUUKcMCAAJ).
If your dependers are using `dep`, this is not a concern, as `dep` takes care of
stripping out nested `vendor` directories.
## How do I configure a dependency that doesn't tag its releases?
Add a constraint to `Gopkg.toml` that specifies `branch: "master"` (or whichever branch you need) in the `[[constraint]]` for that dependency. `dep ensure` will determine the current revision of your dependency's master branch, and place it in `Gopkg.lock` for you. See also: [What is the difference between Gopkg.toml and Gopkg.lock?](#what-is-the-difference-between-gopkgtoml-the-manifest-and-gopkglock-the-lock)
## How do I use `dep` with Docker?
`dep ensure -vendor-only` creates the vendor folder from a valid `Gopkg.toml` and `Gopkg.lock` without checking for Go code.
This is especially useful for builds inside docker utilizing cache layers.
Sample dockerfile:
FROM golang:1.9 AS builder
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/vX.X.X/dep-linux-amd64 && chmod +x /usr/local/bin/dep
RUN mkdir -p /go/src/github.com/***
WORKDIR /go/src/github.com/***
COPY Gopkg.toml Gopkg.lock ./
# copies the Gopkg.toml and Gopkg.lock to WORKDIR
RUN dep ensure -vendor-only
# install the dependencies without checking for go code
...
dep-0.3.2/docs/Gopkg.toml.md 0000664 0000000 0000000 00000015214 13171666371 0015575 0 ustar 00root root 0000000 0000000 # Gopkg.toml
## `required`
`required` lists a set of packages (not projects) that must be included in
Gopkg.lock. This list is merged with the set of packages imported by the current
project.
```toml
required = ["github.com/user/thing/cmd/thing"]
```
**Use this for:** linters, generators, and other development tools that
* Are needed by your project
* Aren't `import`ed by your project, [directly or transitively](FAQ.md#what-is-a-direct-or-transitive-dependency)
* You don't want put in your `GOPATH`, and/or you want to lock the version
Please note that this only pulls in the sources of these dependencies. It does not install or compile them. So, if you need the tool to be installed you should still run the following (manually or from a `Makefile`) after each `dep ensure`:
```bash
cd vendor/pkg/to/install
go install .
```
This only works reliably if this is the only project to install these executables. This is not enough if you want to be able to run a different version of the same executable depending on the project you're working. In that case you have to use a different `GOBIN` for each project, by doing something like this before running the above commands:
```bash
export GOBIN=$PWD/bin
export PATH=$GOBIN:$PATH
```
You might also try [virtualgo](https://github.com/GetStream/vg), which installs dependencies in the `required` list automatically in a project specific `GOBIN`.
## `ignored`
`ignored` lists a set of packages (not projects) that are ignored when dep statically analyzes source code. Ignored packages can be in this project, or in a dependency.
```toml
ignored = ["github.com/user/project/badpkg"]
```
Use wildcard character (*) to define a package prefix to be ignored. Use this
to ignore any package and their subpackages.
```toml
ignored = ["github.com/user/project/badpkg*"]
```
**Use this for:** preventing a package and any of that package's unique
dependencies from being installed.
## `metadata`
`metadata` can exist at the root as well as under `constraint` and `override` declarations.
`metadata` declarations are ignored by dep and are meant for usage by other independent systems.
A `metadata` declaration at the root defines metadata about the project itself. While a `metadata` declaration under a `constraint` or an `override` defines metadata about that `constraint` or `override`.
```toml
[metadata]
key1 = "value that convey data to other systems"
system1-data = "value that is used by a system"
system2-data = "value that is used by another system"
```
## `constraint`
A `constraint` provides rules for how a [direct dependency](FAQ.md#what-is-a-direct-or-transitive-dependency) may be incorporated into the
dependency graph.
They are respected by dep whether coming from the Gopkg.toml of the current project or a dependency.
```toml
[[constraint]]
# Required: the root import path of the project being constrained.
name = "github.com/user/project"
# Recommended: the version constraint to enforce for the project.
# Only one of "branch", "version" or "revision" can be specified.
version = "1.0.0"
branch = "master"
revision = "abc123"
# Optional: an alternate location (URL or import path) for the project's source.
source = "https://github.com/myfork/package.git"
# Optional: metadata about the constraint or override that could be used by other independent systems
[metadata]
key1 = "value that convey data to other systems"
system1-data = "value that is used by a system"
system2-data = "value that is used by another system"
```
**Use this for:** having a [direct dependency](FAQ.md#what-is-a-direct-or-transitive-dependency)
use a specific branch, version range, revision, or alternate source (such as a
fork).
## `override`
An `override` has the same structure as a `constraint` declaration, but supersede all `constraint` declarations from all projects. Only `override` declarations from the current project's `Gopkg.toml` are applied.
```toml
[[override]]
# Required: the root import path of the project being constrained.
name = "github.com/user/project"
# Optional: specifying a version constraint override will cause all other constraints on this project to be ignored; only the overridden constraint needs to be satisfied. Again, only one of "branch", "version" or "revision" can be specified.
version = "1.0.0"
branch = "master"
revision = "abc123"
# Optional: specifying an alternate source location as an override will enforce that the alternate location is used for that project, regardless of what source location any dependent projects specify.
source = "https://github.com/myfork/package.git"
# Optional: metadata about the constraint or override that could be used by other independent systems
[metadata]
key1 = "value that convey data to other systems"
system1-data = "value that is used by a system"
system2-data = "value that is used by another system"
```
**Use this for:** all the same things as a [`constraint`](#constraint), but for
[transitive dependencies](FAQ.md#what-is-a-direct-or-transitive-dependency).
See [How do I constrain a transitive dependency's version?](FAQ.md#how-do-i-constrain-a-transitive-dependencys-version)
for more details on how overrides differ from `constraint`s. _Overrides should
be used cautiously, sparingly, and temporarily._
## `version`
`version` is a property of `constraint`s and `override`s. It is used to specify
version constraint of a specific dependency.
Internally, dep uses [Masterminds/semver](https://github.com/Masterminds/semver)
to work with semver versioning.
`~` and `=` operators can be used with the versions. When a version is specified
without any operator, `dep` automatically adds a caret operator, `^`. The caret
operator pins the left-most non-zero digit in the version. For example:
```
^1.2.3 means 1.2.3 <= X < 2.0.0
^0.2.3 means 0.2.3 <= X < 0.3.0
^0.0.3 means 0.0.3 <= X < 0.1.0
```
To pin a version of direct dependency in manifest, prefix the version with `=`.
For example:
```toml
[[constraint]]
name = "github.com/pkg/errors"
version = "=0.8.0"
```
[Why is dep ignoring a version constraint in the manifest?](FAQ.md#why-is-dep-ignoring-a-version-constraint-in-the-manifest)
# Example
Here's an example of a sample Gopkg.toml with most of the elements
```toml
required = ["github.com/user/thing/cmd/thing"]
ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
[metadata]
codename = "foo"
[[constraint]]
name = "github.com/user/project"
version = "1.0.0"
[metadata]
property1 = "value1"
property2 = 10
[[constraint]]
name = "github.com/user/project2"
branch = "dev"
source = "github.com/myfork/project2"
[[override]]
name = "github.com/x/y"
version = "2.4.0"
[metadata]
propertyX = "valueX"
```
dep-0.3.2/docs/img/ 0000775 0000000 0000000 00000000000 13171666371 0014003 5 ustar 00root root 0000000 0000000 dep-0.3.2/docs/img/DigbyFlat.png 0000664 0000000 0000000 00001401104 13171666371 0016357 0 ustar 00root root 0000000 0000000 PNG
IHDR j pHYs .# .#x?v IDATxt}'O{zF_زG%K>{b"ABn)7-7
.ͯ6l6N]ҴIw6 I6Bom8K)Id1sC,clFvC#idkxyy~__ *QdXZ1/"Z"bk#l$ W -J3]÷|""=W ./%w *$j>bWidFDODl=3$ (%w JLKDL<ӵj."_xv Qr jZdhI|2Zp!}tڎȗ#b{6{d@$ 0; $)fZH_%z5ѓ9# tJ
#"f%Yܮ8G$ 0=%w @I)fmtaN{#" `$I%"ZX9TW#_x3b ) P$ FK)+̱]1# j; %$)fZH_%Ԁq~{O6{d@$ T+%w Vt1ӵ.̹"_x" Z( $tt6_ UoWK1:G$ T"%w $-S,tMRx5.(3b ) %I2b$>Bk-QR Ԁb" ( EKLK3-/秽dGzD U@<"bk]j=Fg @( @ $I3FO Jक़8}H +J Ԥ$ɴDD3]S: jɎȗ#b{6{d@$ %w BdhI|2Zp!}t JGO6{X TJ L)I2S,ʹ "K f슉{D t \