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

Commit f3da373

Browse files
committed
Expand example Gopkg.toml text; always add on init
1 parent 640786c commit f3da373

File tree

15 files changed

+666
-16
lines changed

15 files changed

+666
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,45 @@
11

2-
# Example:
2+
## Dependencies define constraints on how dependent projects should be
3+
## incorporated into Gopkg.lock. They are respected by dep whether
4+
## this project is the current project, or if it's a dependency.
35
# [[dependencies]]
6+
## Required: the root import path of the project being constrained
7+
# name = "github.com/user/project"
8+
## Optional: an alternate location (URL or import path) for the project's source
49
# source = "https://github.com/myfork/package.git"
10+
## Optional, but recommended: the version constraint to enforce for the project.
11+
## Only one of "branch", "version" or "revision" can be specified.
12+
# version = "1.0.0"
513
# branch = "master"
6-
# name = "github.com/vendor/package"
7-
# Note: revision will depend on your repository type, i.e git, svc, bzr etc...
14+
## Note: revision will depend on your repository type; git and hg have SHA1s,
15+
## bzr a 3-part id, svn a revision number.
816
# revision = "abc123"
17+
18+
## Overrides have the same structure as [[dependencies]], but supercede all
19+
## [[dependencies]] declarations from all projects. However, only the current
20+
## project's overrides will apply.
21+
##
22+
## Overrides are a sledgehammer, and should be used only as a last resort.
23+
# [[overrides]]
24+
## Required: the root import path of the project being constrained
25+
# name = "github.com/user/project"
26+
## Optional: an alternate location (URL or import path) for the project's source
27+
# source = "https://github.com/myfork/package.git"
28+
## Optional, but recommended: the version constraint to enforce for the project.
29+
## Only one of "branch", "version" or "revision" can be specified.
930
# version = "1.0.0"
31+
# branch = "master"
32+
## Note: revision will depend on your repository type; git and hg have SHA1s,
33+
## bzr a 3-part id, svn a revision number.
34+
# revision = "abc123"
35+
36+
## "required" lists a set of packages (not projects) that must be included in
37+
## Gopkg.lock. This has the same effect as directly importing a package, but
38+
## can be used to require "main" packages.
39+
# required = ["github.com/user/thing/cmd/thing"]
40+
41+
## "ignored" lists a set of packages (not projects) that are ignored when
42+
## dep statically analyzes source code. Ignored packages can be in this project,
43+
## or in a dependency.
44+
# ignored = ["github.com/user/project/badpkg"]
45+

cmd/dep/testdata/harness_tests/ensure/empty/case2/final/Gopkg.toml

+45
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,48 @@
22
[[dependencies]]
33
name = "github.com/sdboyer/deptest"
44
version = "^0.8.0"
5+
6+
## Dependencies define constraints on how dependent projects should be
7+
## incorporated into Gopkg.lock. They are respected by dep whether
8+
## this project is the current project, or if it's a dependency.
9+
# [[dependencies]]
10+
## Required: the root import path of the project being constrained
11+
# name = "github.com/user/project"
12+
## Optional: an alternate location (URL or import path) for the project's source
13+
# source = "https://github.com/myfork/package.git"
14+
## Optional, but recommended: the version constraint to enforce for the project.
15+
## Only one of "branch", "version" or "revision" can be specified.
16+
# version = "1.0.0"
17+
# branch = "master"
18+
## Note: revision will depend on your repository type; git and hg have SHA1s,
19+
## bzr a 3-part id, svn a revision number.
20+
# revision = "abc123"
21+
22+
## Overrides have the same structure as [[dependencies]], but supercede all
23+
## [[dependencies]] declarations from all projects. However, only the current
24+
## project's overrides will apply.
25+
##
26+
## Overrides are a sledgehammer, and should be used only as a last resort.
27+
# [[overrides]]
28+
## Required: the root import path of the project being constrained
29+
# name = "github.com/user/project"
30+
## Optional: an alternate location (URL or import path) for the project's source
31+
# source = "https://github.com/myfork/package.git"
32+
## Optional, but recommended: the version constraint to enforce for the project.
33+
## Only one of "branch", "version" or "revision" can be specified.
34+
# version = "1.0.0"
35+
# branch = "master"
36+
## Note: revision will depend on your repository type; git and hg have SHA1s,
37+
## bzr a 3-part id, svn a revision number.
38+
# revision = "abc123"
39+
40+
## "required" lists a set of packages (not projects) that must be included in
41+
## Gopkg.lock. This has the same effect as directly importing a package, but
42+
## can be used to require "main" packages.
43+
# required = ["github.com/user/thing/cmd/thing"]
44+
45+
## "ignored" lists a set of packages (not projects) that are ignored when
46+
## dep statically analyzes source code. Ignored packages can be in this project,
47+
## or in a dependency.
48+
# ignored = ["github.com/user/project/badpkg"]
49+

cmd/dep/testdata/harness_tests/ensure/empty/case3/final/Gopkg.toml

+45
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,48 @@ ignored = ["github.com/sdboyer/deptestdos"]
33
[[dependencies]]
44
branch = "master"
55
name = "github.com/sdboyer/deptest"
6+
7+
## Dependencies define constraints on how dependent projects should be
8+
## incorporated into Gopkg.lock. They are respected by dep whether
9+
## this project is the current project, or if it's a dependency.
10+
# [[dependencies]]
11+
## Required: the root import path of the project being constrained
12+
# name = "github.com/user/project"
13+
## Optional: an alternate location (URL or import path) for the project's source
14+
# source = "https://github.com/myfork/package.git"
15+
## Optional, but recommended: the version constraint to enforce for the project.
16+
## Only one of "branch", "version" or "revision" can be specified.
17+
# version = "1.0.0"
18+
# branch = "master"
19+
## Note: revision will depend on your repository type; git and hg have SHA1s,
20+
## bzr a 3-part id, svn a revision number.
21+
# revision = "abc123"
22+
23+
## Overrides have the same structure as [[dependencies]], but supercede all
24+
## [[dependencies]] declarations from all projects. However, only the current
25+
## project's overrides will apply.
26+
##
27+
## Overrides are a sledgehammer, and should be used only as a last resort.
28+
# [[overrides]]
29+
## Required: the root import path of the project being constrained
30+
# name = "github.com/user/project"
31+
## Optional: an alternate location (URL or import path) for the project's source
32+
# source = "https://github.com/myfork/package.git"
33+
## Optional, but recommended: the version constraint to enforce for the project.
34+
## Only one of "branch", "version" or "revision" can be specified.
35+
# version = "1.0.0"
36+
# branch = "master"
37+
## Note: revision will depend on your repository type; git and hg have SHA1s,
38+
## bzr a 3-part id, svn a revision number.
39+
# revision = "abc123"
40+
41+
## "required" lists a set of packages (not projects) that must be included in
42+
## Gopkg.lock. This has the same effect as directly importing a package, but
43+
## can be used to require "main" packages.
44+
# required = ["github.com/user/thing/cmd/thing"]
45+
46+
## "ignored" lists a set of packages (not projects) that are ignored when
47+
## dep statically analyzes source code. Ignored packages can be in this project,
48+
## or in a dependency.
49+
# ignored = ["github.com/user/project/badpkg"]
50+

cmd/dep/testdata/harness_tests/ensure/override/case1/final/Gopkg.toml

+45
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,48 @@
22
[[overrides]]
33
name = "github.com/sdboyer/deptest"
44
version = "1.0.0"
5+
6+
## Dependencies define constraints on how dependent projects should be
7+
## incorporated into Gopkg.lock. They are respected by dep whether
8+
## this project is the current project, or if it's a dependency.
9+
# [[dependencies]]
10+
## Required: the root import path of the project being constrained
11+
# name = "github.com/user/project"
12+
## Optional: an alternate location (URL or import path) for the project's source
13+
# source = "https://github.com/myfork/package.git"
14+
## Optional, but recommended: the version constraint to enforce for the project.
15+
## Only one of "branch", "version" or "revision" can be specified.
16+
# version = "1.0.0"
17+
# branch = "master"
18+
## Note: revision will depend on your repository type; git and hg have SHA1s,
19+
## bzr a 3-part id, svn a revision number.
20+
# revision = "abc123"
21+
22+
## Overrides have the same structure as [[dependencies]], but supercede all
23+
## [[dependencies]] declarations from all projects. However, only the current
24+
## project's overrides will apply.
25+
##
26+
## Overrides are a sledgehammer, and should be used only as a last resort.
27+
# [[overrides]]
28+
## Required: the root import path of the project being constrained
29+
# name = "github.com/user/project"
30+
## Optional: an alternate location (URL or import path) for the project's source
31+
# source = "https://github.com/myfork/package.git"
32+
## Optional, but recommended: the version constraint to enforce for the project.
33+
## Only one of "branch", "version" or "revision" can be specified.
34+
# version = "1.0.0"
35+
# branch = "master"
36+
## Note: revision will depend on your repository type; git and hg have SHA1s,
37+
## bzr a 3-part id, svn a revision number.
38+
# revision = "abc123"
39+
40+
## "required" lists a set of packages (not projects) that must be included in
41+
## Gopkg.lock. This has the same effect as directly importing a package, but
42+
## can be used to require "main" packages.
43+
# required = ["github.com/user/thing/cmd/thing"]
44+
45+
## "ignored" lists a set of packages (not projects) that are ignored when
46+
## dep statically analyzes source code. Ignored packages can be in this project,
47+
## or in a dependency.
48+
# ignored = ["github.com/user/project/badpkg"]
49+

cmd/dep/testdata/harness_tests/init/case1/final/Gopkg.toml

+45
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,48 @@
66
[[dependencies]]
77
name = "github.com/sdboyer/deptestdos"
88
revision = "a0196baa11ea047dd65037287451d36b861b00ea"
9+
10+
## Dependencies define constraints on how dependent projects should be
11+
## incorporated into Gopkg.lock. They are respected by dep whether
12+
## this project is the current project, or if it's a dependency.
13+
# [[dependencies]]
14+
## Required: the root import path of the project being constrained
15+
# name = "github.com/user/project"
16+
## Optional: an alternate location (URL or import path) for the project's source
17+
# source = "https://github.com/myfork/package.git"
18+
## Optional, but recommended: the version constraint to enforce for the project.
19+
## Only one of "branch", "version" or "revision" can be specified.
20+
# version = "1.0.0"
21+
# branch = "master"
22+
## Note: revision will depend on your repository type; git and hg have SHA1s,
23+
## bzr a 3-part id, svn a revision number.
24+
# revision = "abc123"
25+
26+
## Overrides have the same structure as [[dependencies]], but supercede all
27+
## [[dependencies]] declarations from all projects. However, only the current
28+
## project's overrides will apply.
29+
##
30+
## Overrides are a sledgehammer, and should be used only as a last resort.
31+
# [[overrides]]
32+
## Required: the root import path of the project being constrained
33+
# name = "github.com/user/project"
34+
## Optional: an alternate location (URL or import path) for the project's source
35+
# source = "https://github.com/myfork/package.git"
36+
## Optional, but recommended: the version constraint to enforce for the project.
37+
## Only one of "branch", "version" or "revision" can be specified.
38+
# version = "1.0.0"
39+
# branch = "master"
40+
## Note: revision will depend on your repository type; git and hg have SHA1s,
41+
## bzr a 3-part id, svn a revision number.
42+
# revision = "abc123"
43+
44+
## "required" lists a set of packages (not projects) that must be included in
45+
## Gopkg.lock. This has the same effect as directly importing a package, but
46+
## can be used to require "main" packages.
47+
# required = ["github.com/user/thing/cmd/thing"]
48+
49+
## "ignored" lists a set of packages (not projects) that are ignored when
50+
## dep statically analyzes source code. Ignored packages can be in this project,
51+
## or in a dependency.
52+
# ignored = ["github.com/user/project/badpkg"]
53+

cmd/dep/testdata/harness_tests/init/case2/final/Gopkg.toml

+45
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,48 @@
22
[[dependencies]]
33
name = "github.com/sdboyer/deptest"
44
version = ">=0.8.0, <1.0.0"
5+
6+
## Dependencies define constraints on how dependent projects should be
7+
## incorporated into Gopkg.lock. They are respected by dep whether
8+
## this project is the current project, or if it's a dependency.
9+
# [[dependencies]]
10+
## Required: the root import path of the project being constrained
11+
# name = "github.com/user/project"
12+
## Optional: an alternate location (URL or import path) for the project's source
13+
# source = "https://github.com/myfork/package.git"
14+
## Optional, but recommended: the version constraint to enforce for the project.
15+
## Only one of "branch", "version" or "revision" can be specified.
16+
# version = "1.0.0"
17+
# branch = "master"
18+
## Note: revision will depend on your repository type; git and hg have SHA1s,
19+
## bzr a 3-part id, svn a revision number.
20+
# revision = "abc123"
21+
22+
## Overrides have the same structure as [[dependencies]], but supercede all
23+
## [[dependencies]] declarations from all projects. However, only the current
24+
## project's overrides will apply.
25+
##
26+
## Overrides are a sledgehammer, and should be used only as a last resort.
27+
# [[overrides]]
28+
## Required: the root import path of the project being constrained
29+
# name = "github.com/user/project"
30+
## Optional: an alternate location (URL or import path) for the project's source
31+
# source = "https://github.com/myfork/package.git"
32+
## Optional, but recommended: the version constraint to enforce for the project.
33+
## Only one of "branch", "version" or "revision" can be specified.
34+
# version = "1.0.0"
35+
# branch = "master"
36+
## Note: revision will depend on your repository type; git and hg have SHA1s,
37+
## bzr a 3-part id, svn a revision number.
38+
# revision = "abc123"
39+
40+
## "required" lists a set of packages (not projects) that must be included in
41+
## Gopkg.lock. This has the same effect as directly importing a package, but
42+
## can be used to require "main" packages.
43+
# required = ["github.com/user/thing/cmd/thing"]
44+
45+
## "ignored" lists a set of packages (not projects) that are ignored when
46+
## dep statically analyzes source code. Ignored packages can be in this project,
47+
## or in a dependency.
48+
# ignored = ["github.com/user/project/badpkg"]
49+

cmd/dep/testdata/harness_tests/init/case3/final/Gopkg.toml

+45
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,48 @@
66
[[dependencies]]
77
name = "github.com/sdboyer/deptestdos"
88
revision = "a0196baa11ea047dd65037287451d36b861b00ea"
9+
10+
## Dependencies define constraints on how dependent projects should be
11+
## incorporated into Gopkg.lock. They are respected by dep whether
12+
## this project is the current project, or if it's a dependency.
13+
# [[dependencies]]
14+
## Required: the root import path of the project being constrained
15+
# name = "github.com/user/project"
16+
## Optional: an alternate location (URL or import path) for the project's source
17+
# source = "https://github.com/myfork/package.git"
18+
## Optional, but recommended: the version constraint to enforce for the project.
19+
## Only one of "branch", "version" or "revision" can be specified.
20+
# version = "1.0.0"
21+
# branch = "master"
22+
## Note: revision will depend on your repository type; git and hg have SHA1s,
23+
## bzr a 3-part id, svn a revision number.
24+
# revision = "abc123"
25+
26+
## Overrides have the same structure as [[dependencies]], but supercede all
27+
## [[dependencies]] declarations from all projects. However, only the current
28+
## project's overrides will apply.
29+
##
30+
## Overrides are a sledgehammer, and should be used only as a last resort.
31+
# [[overrides]]
32+
## Required: the root import path of the project being constrained
33+
# name = "github.com/user/project"
34+
## Optional: an alternate location (URL or import path) for the project's source
35+
# source = "https://github.com/myfork/package.git"
36+
## Optional, but recommended: the version constraint to enforce for the project.
37+
## Only one of "branch", "version" or "revision" can be specified.
38+
# version = "1.0.0"
39+
# branch = "master"
40+
## Note: revision will depend on your repository type; git and hg have SHA1s,
41+
## bzr a 3-part id, svn a revision number.
42+
# revision = "abc123"
43+
44+
## "required" lists a set of packages (not projects) that must be included in
45+
## Gopkg.lock. This has the same effect as directly importing a package, but
46+
## can be used to require "main" packages.
47+
# required = ["github.com/user/thing/cmd/thing"]
48+
49+
## "ignored" lists a set of packages (not projects) that are ignored when
50+
## dep statically analyzes source code. Ignored packages can be in this project,
51+
## or in a dependency.
52+
# ignored = ["github.com/user/project/badpkg"]
53+
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,45 @@
11

2-
# Example:
2+
## Dependencies define constraints on how dependent projects should be
3+
## incorporated into Gopkg.lock. They are respected by dep whether
4+
## this project is the current project, or if it's a dependency.
35
# [[dependencies]]
6+
## Required: the root import path of the project being constrained
7+
# name = "github.com/user/project"
8+
## Optional: an alternate location (URL or import path) for the project's source
49
# source = "https://github.com/myfork/package.git"
10+
## Optional, but recommended: the version constraint to enforce for the project.
11+
## Only one of "branch", "version" or "revision" can be specified.
12+
# version = "1.0.0"
513
# branch = "master"
6-
# name = "github.com/vendor/package"
7-
# Note: revision will depend on your repository type, i.e git, svc, bzr etc...
14+
## Note: revision will depend on your repository type; git and hg have SHA1s,
15+
## bzr a 3-part id, svn a revision number.
816
# revision = "abc123"
17+
18+
## Overrides have the same structure as [[dependencies]], but supercede all
19+
## [[dependencies]] declarations from all projects. However, only the current
20+
## project's overrides will apply.
21+
##
22+
## Overrides are a sledgehammer, and should be used only as a last resort.
23+
# [[overrides]]
24+
## Required: the root import path of the project being constrained
25+
# name = "github.com/user/project"
26+
## Optional: an alternate location (URL or import path) for the project's source
27+
# source = "https://github.com/myfork/package.git"
28+
## Optional, but recommended: the version constraint to enforce for the project.
29+
## Only one of "branch", "version" or "revision" can be specified.
930
# version = "1.0.0"
31+
# branch = "master"
32+
## Note: revision will depend on your repository type; git and hg have SHA1s,
33+
## bzr a 3-part id, svn a revision number.
34+
# revision = "abc123"
35+
36+
## "required" lists a set of packages (not projects) that must be included in
37+
## Gopkg.lock. This has the same effect as directly importing a package, but
38+
## can be used to require "main" packages.
39+
# required = ["github.com/user/thing/cmd/thing"]
40+
41+
## "ignored" lists a set of packages (not projects) that are ignored when
42+
## dep statically analyzes source code. Ignored packages can be in this project,
43+
## or in a dependency.
44+
# ignored = ["github.com/user/project/badpkg"]
45+

0 commit comments

Comments
 (0)