Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Expand example Gopkg.toml text; always add on init #462

Merged
merged 5 commits into from
Apr 28, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,44 @@

# Example:
## Dependencies define constraints on how dependent projects should be
## incorporated into Gopkg.lock. They are respected by dep whether
## this project is the current project, or if it's a dependency.
# [[dependencies]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
# name = "github.com/vendor/package"
# Note: revision will depend on your repository type, i.e git, svc, bzr etc...
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## Overrides have the same structure as [[dependencies]], but supercede all
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supersede

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hah, no kidding 😛

## [[dependencies]] declarations from all projects. However, only the current
## project's overrides will apply.
##
## Overrides are a sledgehammer, and should be used only as a last resort.
# [[overrides]]
## Required: the root import path of the project being constrained
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps just note that they have the same format, rather than repeating everything?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that'll help cut down on length, 👍

# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but recommended: the version constraint to enforce for the project.
## Only one of "branch", "version" or "revision" can be specified.
# version = "1.0.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a constraint string like ">=0.4.0, <1.0.0" or a specific version it has to be? Might be helpful to briefly describe these in here, or add a second line to make this behavior clear

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be either (though note that when #225 goes in, 1.0.0 will be interpreted as ^1.0.0). It can also specify an entirely non-semver tag for a literal match.

We need a more formal writeup of all of these rules. The examples here should really just be terse, and point to said writeup.

# branch = "master"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## "required" lists a set of packages (not projects) that must be included in
## Gopkg.lock. This has the same effect as directly importing a package, but
## can be used to require "main" packages.
# required = ["github.com/user/thing/cmd/thing"]

## "ignored" lists a set of packages (not projects) that are ignored when
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ignored when/ignored completely when/

## dep statically analyzes source code. Ignored packages can be in this project,
## or in a dependency.
# ignored = ["github.com/user/project/badpkg"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,47 @@
[[dependencies]]
name = "github.com/sdboyer/deptest"
version = "^0.8.0"

## Dependencies define constraints on how dependent projects should be
## incorporated into Gopkg.lock. They are respected by dep whether
## this project is the current project, or if it's a dependency.
# [[dependencies]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## Overrides have the same structure as [[dependencies]], but supercede all
## [[dependencies]] declarations from all projects. However, only the current
## project's overrides will apply.
##
## Overrides are a sledgehammer, and should be used only as a last resort.
# [[overrides]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## "required" lists a set of packages (not projects) that must be included in
## Gopkg.lock. This has the same effect as directly importing a package, but
## can be used to require "main" packages.
# required = ["github.com/user/thing/cmd/thing"]

## "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.
# ignored = ["github.com/user/project/badpkg"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,47 @@ ignored = ["github.com/sdboyer/deptestdos"]
[[dependencies]]
branch = "master"
name = "github.com/sdboyer/deptest"

## Dependencies define constraints on how dependent projects should be
## incorporated into Gopkg.lock. They are respected by dep whether
## this project is the current project, or if it's a dependency.
# [[dependencies]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## Overrides have the same structure as [[dependencies]], but supercede all
## [[dependencies]] declarations from all projects. However, only the current
## project's overrides will apply.
##
## Overrides are a sledgehammer, and should be used only as a last resort.
# [[overrides]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## "required" lists a set of packages (not projects) that must be included in
## Gopkg.lock. This has the same effect as directly importing a package, but
## can be used to require "main" packages.
# required = ["github.com/user/thing/cmd/thing"]

## "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.
# ignored = ["github.com/user/project/badpkg"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,47 @@
[[overrides]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"

## Dependencies define constraints on how dependent projects should be
## incorporated into Gopkg.lock. They are respected by dep whether
## this project is the current project, or if it's a dependency.
# [[dependencies]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## Overrides have the same structure as [[dependencies]], but supercede all
## [[dependencies]] declarations from all projects. However, only the current
## project's overrides will apply.
##
## Overrides are a sledgehammer, and should be used only as a last resort.
# [[overrides]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## "required" lists a set of packages (not projects) that must be included in
## Gopkg.lock. This has the same effect as directly importing a package, but
## can be used to require "main" packages.
# required = ["github.com/user/thing/cmd/thing"]

## "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.
# ignored = ["github.com/user/project/badpkg"]
44 changes: 44 additions & 0 deletions cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,47 @@
[[dependencies]]
name = "github.com/sdboyer/deptestdos"
revision = "a0196baa11ea047dd65037287451d36b861b00ea"

## Dependencies define constraints on how dependent projects should be
## incorporated into Gopkg.lock. They are respected by dep whether
## this project is the current project, or if it's a dependency.
# [[dependencies]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## Overrides have the same structure as [[dependencies]], but supercede all
## [[dependencies]] declarations from all projects. However, only the current
## project's overrides will apply.
##
## Overrides are a sledgehammer, and should be used only as a last resort.
# [[overrides]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## "required" lists a set of packages (not projects) that must be included in
## Gopkg.lock. This has the same effect as directly importing a package, but
## can be used to require "main" packages.
# required = ["github.com/user/thing/cmd/thing"]

## "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.
# ignored = ["github.com/user/project/badpkg"]
44 changes: 44 additions & 0 deletions cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,47 @@
[[dependencies]]
name = "github.com/sdboyer/deptest"
version = ">=0.8.0, <1.0.0"

## Dependencies define constraints on how dependent projects should be
## incorporated into Gopkg.lock. They are respected by dep whether
## this project is the current project, or if it's a dependency.
# [[dependencies]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## Overrides have the same structure as [[dependencies]], but supercede all
## [[dependencies]] declarations from all projects. However, only the current
## project's overrides will apply.
##
## Overrides are a sledgehammer, and should be used only as a last resort.
# [[overrides]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## "required" lists a set of packages (not projects) that must be included in
## Gopkg.lock. This has the same effect as directly importing a package, but
## can be used to require "main" packages.
# required = ["github.com/user/thing/cmd/thing"]

## "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.
# ignored = ["github.com/user/project/badpkg"]
44 changes: 44 additions & 0 deletions cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,47 @@
[[dependencies]]
name = "github.com/sdboyer/deptestdos"
revision = "a0196baa11ea047dd65037287451d36b861b00ea"

## Dependencies define constraints on how dependent projects should be
## incorporated into Gopkg.lock. They are respected by dep whether
## this project is the current project, or if it's a dependency.
# [[dependencies]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## Overrides have the same structure as [[dependencies]], but supercede all
## [[dependencies]] declarations from all projects. However, only the current
## project's overrides will apply.
##
## Overrides are a sledgehammer, and should be used only as a last resort.
# [[overrides]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## "required" lists a set of packages (not projects) that must be included in
## Gopkg.lock. This has the same effect as directly importing a package, but
## can be used to require "main" packages.
# required = ["github.com/user/thing/cmd/thing"]

## "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.
# ignored = ["github.com/user/project/badpkg"]
Original file line number Diff line number Diff line change
@@ -1,9 +1,44 @@

# Example:
## Dependencies define constraints on how dependent projects should be
## incorporated into Gopkg.lock. They are respected by dep whether
## this project is the current project, or if it's a dependency.
# [[dependencies]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
# name = "github.com/vendor/package"
# Note: revision will depend on your repository type, i.e git, svc, bzr etc...
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## Overrides have the same structure as [[dependencies]], but supercede all
## [[dependencies]] declarations from all projects. However, only the current
## project's overrides will apply.
##
## Overrides are a sledgehammer, and should be used only as a last resort.
# [[overrides]]
## Required: the root import path of the project being constrained
# name = "github.com/user/project"
## Optional: an alternate location (URL or import path) for the project's source
# source = "https://github.com/myfork/package.git"
## Optional, but 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"
## Note: revision will depend on your repository type; git and hg have SHA1s,
## bzr a 3-part id, svn a revision number.
# revision = "abc123"

## "required" lists a set of packages (not projects) that must be included in
## Gopkg.lock. This has the same effect as directly importing a package, but
## can be used to require "main" packages.
# required = ["github.com/user/thing/cmd/thing"]

## "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.
# ignored = ["github.com/user/project/badpkg"]
Loading