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

Commit 11b52a3

Browse files
authored
Merge pull request #462 from sdboyer/expand-examples
Expand example Gopkg.toml text; always add on init
2 parents 89e092a + f861939 commit 11b52a3

File tree

15 files changed

+775
-19
lines changed

15 files changed

+775
-19
lines changed
Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,52 @@
11

2-
# Example:
2+
## Gopkg.toml example (these lines may be deleted)
3+
4+
## "required" lists a set of packages (not projects) that must be included in
5+
## Gopkg.lock. This list is merged with the set of packages imported by the current
6+
## project. Use it when your project needs a package it doesn't explicitly import -
7+
## including "main" packages.
8+
# required = ["github.com/user/thing/cmd/thing"]
9+
10+
## "ignored" lists a set of packages (not projects) that are ignored when
11+
## dep statically analyzes source code. Ignored packages can be in this project,
12+
## or in a dependency.
13+
# ignored = ["github.com/user/project/badpkg"]
14+
15+
## Dependencies define constraints on dependent projects. They are respected by
16+
## dep whether coming from the Gopkg.toml of the current project or a dependency.
317
# [[dependencies]]
4-
# source = "https://github.com/myfork/package.git"
18+
## Required: the root import path of the project being constrained.
19+
# name = "github.com/user/project"
20+
#
21+
## Recommended: the version constraint to enforce for the project.
22+
## Only one of "branch", "version" or "revision" can be specified.
23+
# version = "1.0.0"
524
# branch = "master"
6-
# name = "github.com/vendor/package"
7-
# Note: revision will depend on your repository type, i.e git, svc, bzr etc...
825
# revision = "abc123"
26+
#
27+
## Optional: an alternate location (URL or import path) for the project's source.
28+
# source = "https://github.com/myfork/package.git"
29+
30+
## Overrides have the same structure as [[dependencies]], but supercede all
31+
## [[dependencies]] declarations from all projects. Only the current project's
32+
## [[overrides]] are applied.
33+
##
34+
## Overrides are a sledgehammer. Use them only as a last resort.
35+
# [[overrides]]
36+
## Required: the root import path of the project being constrained.
37+
# name = "github.com/user/project"
38+
#
39+
## Optional: specifying a version constraint override will cause all other
40+
## constraints on this project to be ignored; only the overriden constraint
41+
## need be satisfied.
42+
## Again, only one of "branch", "version" or "revision" can be specified.
943
# version = "1.0.0"
44+
# branch = "master"
45+
# revision = "abc123"
46+
#
47+
## Optional: specifying an alternate source location as an override will
48+
## enforce that the alternate location is used for that project, regardless of
49+
## what source location any dependent projects specify.
50+
# source = "https://github.com/myfork/package.git"
51+
52+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,56 @@
11

2+
## Gopkg.toml example (these lines may be deleted)
3+
4+
## "required" lists a set of packages (not projects) that must be included in
5+
## Gopkg.lock. This list is merged with the set of packages imported by the current
6+
## project. Use it when your project needs a package it doesn't explicitly import -
7+
## including "main" packages.
8+
# required = ["github.com/user/thing/cmd/thing"]
9+
10+
## "ignored" lists a set of packages (not projects) that are ignored when
11+
## dep statically analyzes source code. Ignored packages can be in this project,
12+
## or in a dependency.
13+
# ignored = ["github.com/user/project/badpkg"]
14+
15+
## Dependencies define constraints on dependent projects. They are respected by
16+
## dep whether coming from the Gopkg.toml of the current project or a dependency.
17+
# [[dependencies]]
18+
## Required: the root import path of the project being constrained.
19+
# name = "github.com/user/project"
20+
#
21+
## Recommended: the version constraint to enforce for the project.
22+
## Only one of "branch", "version" or "revision" can be specified.
23+
# version = "1.0.0"
24+
# branch = "master"
25+
# revision = "abc123"
26+
#
27+
## Optional: an alternate location (URL or import path) for the project's source.
28+
# source = "https://github.com/myfork/package.git"
29+
30+
## Overrides have the same structure as [[dependencies]], but supercede all
31+
## [[dependencies]] declarations from all projects. Only the current project's
32+
## [[overrides]] are applied.
33+
##
34+
## Overrides are a sledgehammer. Use them only as a last resort.
35+
# [[overrides]]
36+
## Required: the root import path of the project being constrained.
37+
# name = "github.com/user/project"
38+
#
39+
## Optional: specifying a version constraint override will cause all other
40+
## constraints on this project to be ignored; only the overriden constraint
41+
## need be satisfied.
42+
## Again, only one of "branch", "version" or "revision" can be specified.
43+
# version = "1.0.0"
44+
# branch = "master"
45+
# revision = "abc123"
46+
#
47+
## Optional: specifying an alternate source location as an override will
48+
## enforce that the alternate location is used for that project, regardless of
49+
## what source location any dependent projects specify.
50+
# source = "https://github.com/myfork/package.git"
51+
52+
53+
254
[[dependencies]]
355
name = "github.com/sdboyer/deptest"
456
version = "^0.8.0"

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,55 @@
1+
2+
## Gopkg.toml example (these lines may be deleted)
3+
4+
## "required" lists a set of packages (not projects) that must be included in
5+
## Gopkg.lock. This list is merged with the set of packages imported by the current
6+
## project. Use it when your project needs a package it doesn't explicitly import -
7+
## including "main" packages.
8+
# required = ["github.com/user/thing/cmd/thing"]
9+
10+
## "ignored" lists a set of packages (not projects) that are ignored when
11+
## dep statically analyzes source code. Ignored packages can be in this project,
12+
## or in a dependency.
13+
# ignored = ["github.com/user/project/badpkg"]
14+
15+
## Dependencies define constraints on dependent projects. They are respected by
16+
## dep whether coming from the Gopkg.toml of the current project or a dependency.
17+
# [[dependencies]]
18+
## Required: the root import path of the project being constrained.
19+
# name = "github.com/user/project"
20+
#
21+
## Recommended: the version constraint to enforce for the project.
22+
## Only one of "branch", "version" or "revision" can be specified.
23+
# version = "1.0.0"
24+
# branch = "master"
25+
# revision = "abc123"
26+
#
27+
## Optional: an alternate location (URL or import path) for the project's source.
28+
# source = "https://github.com/myfork/package.git"
29+
30+
## Overrides have the same structure as [[dependencies]], but supercede all
31+
## [[dependencies]] declarations from all projects. Only the current project's
32+
## [[overrides]] are applied.
33+
##
34+
## Overrides are a sledgehammer. Use them only as a last resort.
35+
# [[overrides]]
36+
## Required: the root import path of the project being constrained.
37+
# name = "github.com/user/project"
38+
#
39+
## Optional: specifying a version constraint override will cause all other
40+
## constraints on this project to be ignored; only the overriden constraint
41+
## need be satisfied.
42+
## Again, only one of "branch", "version" or "revision" can be specified.
43+
# version = "1.0.0"
44+
# branch = "master"
45+
# revision = "abc123"
46+
#
47+
## Optional: specifying an alternate source location as an override will
48+
## enforce that the alternate location is used for that project, regardless of
49+
## what source location any dependent projects specify.
50+
# source = "https://github.com/myfork/package.git"
51+
52+
153
ignored = ["github.com/sdboyer/deptestdos"]
254

355
[[dependencies]]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,56 @@
11

2+
## Gopkg.toml example (these lines may be deleted)
3+
4+
## "required" lists a set of packages (not projects) that must be included in
5+
## Gopkg.lock. This list is merged with the set of packages imported by the current
6+
## project. Use it when your project needs a package it doesn't explicitly import -
7+
## including "main" packages.
8+
# required = ["github.com/user/thing/cmd/thing"]
9+
10+
## "ignored" lists a set of packages (not projects) that are ignored when
11+
## dep statically analyzes source code. Ignored packages can be in this project,
12+
## or in a dependency.
13+
# ignored = ["github.com/user/project/badpkg"]
14+
15+
## Dependencies define constraints on dependent projects. They are respected by
16+
## dep whether coming from the Gopkg.toml of the current project or a dependency.
17+
# [[dependencies]]
18+
## Required: the root import path of the project being constrained.
19+
# name = "github.com/user/project"
20+
#
21+
## Recommended: the version constraint to enforce for the project.
22+
## Only one of "branch", "version" or "revision" can be specified.
23+
# version = "1.0.0"
24+
# branch = "master"
25+
# revision = "abc123"
26+
#
27+
## Optional: an alternate location (URL or import path) for the project's source.
28+
# source = "https://github.com/myfork/package.git"
29+
30+
## Overrides have the same structure as [[dependencies]], but supercede all
31+
## [[dependencies]] declarations from all projects. Only the current project's
32+
## [[overrides]] are applied.
33+
##
34+
## Overrides are a sledgehammer. Use them only as a last resort.
35+
# [[overrides]]
36+
## Required: the root import path of the project being constrained.
37+
# name = "github.com/user/project"
38+
#
39+
## Optional: specifying a version constraint override will cause all other
40+
## constraints on this project to be ignored; only the overriden constraint
41+
## need be satisfied.
42+
## Again, only one of "branch", "version" or "revision" can be specified.
43+
# version = "1.0.0"
44+
# branch = "master"
45+
# revision = "abc123"
46+
#
47+
## Optional: specifying an alternate source location as an override will
48+
## enforce that the alternate location is used for that project, regardless of
49+
## what source location any dependent projects specify.
50+
# source = "https://github.com/myfork/package.git"
51+
52+
53+
254
[[overrides]]
355
name = "github.com/sdboyer/deptest"
456
version = "1.0.0"

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,56 @@
11

2+
## Gopkg.toml example (these lines may be deleted)
3+
4+
## "required" lists a set of packages (not projects) that must be included in
5+
## Gopkg.lock. This list is merged with the set of packages imported by the current
6+
## project. Use it when your project needs a package it doesn't explicitly import -
7+
## including "main" packages.
8+
# required = ["github.com/user/thing/cmd/thing"]
9+
10+
## "ignored" lists a set of packages (not projects) that are ignored when
11+
## dep statically analyzes source code. Ignored packages can be in this project,
12+
## or in a dependency.
13+
# ignored = ["github.com/user/project/badpkg"]
14+
15+
## Dependencies define constraints on dependent projects. They are respected by
16+
## dep whether coming from the Gopkg.toml of the current project or a dependency.
17+
# [[dependencies]]
18+
## Required: the root import path of the project being constrained.
19+
# name = "github.com/user/project"
20+
#
21+
## Recommended: the version constraint to enforce for the project.
22+
## Only one of "branch", "version" or "revision" can be specified.
23+
# version = "1.0.0"
24+
# branch = "master"
25+
# revision = "abc123"
26+
#
27+
## Optional: an alternate location (URL or import path) for the project's source.
28+
# source = "https://github.com/myfork/package.git"
29+
30+
## Overrides have the same structure as [[dependencies]], but supercede all
31+
## [[dependencies]] declarations from all projects. Only the current project's
32+
## [[overrides]] are applied.
33+
##
34+
## Overrides are a sledgehammer. Use them only as a last resort.
35+
# [[overrides]]
36+
## Required: the root import path of the project being constrained.
37+
# name = "github.com/user/project"
38+
#
39+
## Optional: specifying a version constraint override will cause all other
40+
## constraints on this project to be ignored; only the overriden constraint
41+
## need be satisfied.
42+
## Again, only one of "branch", "version" or "revision" can be specified.
43+
# version = "1.0.0"
44+
# branch = "master"
45+
# revision = "abc123"
46+
#
47+
## Optional: specifying an alternate source location as an override will
48+
## enforce that the alternate location is used for that project, regardless of
49+
## what source location any dependent projects specify.
50+
# source = "https://github.com/myfork/package.git"
51+
52+
53+
254
[[dependencies]]
355
name = "github.com/sdboyer/deptest"
456
version = ">=0.8.0, <1.0.0"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,56 @@
11

2+
## Gopkg.toml example (these lines may be deleted)
3+
4+
## "required" lists a set of packages (not projects) that must be included in
5+
## Gopkg.lock. This list is merged with the set of packages imported by the current
6+
## project. Use it when your project needs a package it doesn't explicitly import -
7+
## including "main" packages.
8+
# required = ["github.com/user/thing/cmd/thing"]
9+
10+
## "ignored" lists a set of packages (not projects) that are ignored when
11+
## dep statically analyzes source code. Ignored packages can be in this project,
12+
## or in a dependency.
13+
# ignored = ["github.com/user/project/badpkg"]
14+
15+
## Dependencies define constraints on dependent projects. They are respected by
16+
## dep whether coming from the Gopkg.toml of the current project or a dependency.
17+
# [[dependencies]]
18+
## Required: the root import path of the project being constrained.
19+
# name = "github.com/user/project"
20+
#
21+
## Recommended: the version constraint to enforce for the project.
22+
## Only one of "branch", "version" or "revision" can be specified.
23+
# version = "1.0.0"
24+
# branch = "master"
25+
# revision = "abc123"
26+
#
27+
## Optional: an alternate location (URL or import path) for the project's source.
28+
# source = "https://github.com/myfork/package.git"
29+
30+
## Overrides have the same structure as [[dependencies]], but supercede all
31+
## [[dependencies]] declarations from all projects. Only the current project's
32+
## [[overrides]] are applied.
33+
##
34+
## Overrides are a sledgehammer. Use them only as a last resort.
35+
# [[overrides]]
36+
## Required: the root import path of the project being constrained.
37+
# name = "github.com/user/project"
38+
#
39+
## Optional: specifying a version constraint override will cause all other
40+
## constraints on this project to be ignored; only the overriden constraint
41+
## need be satisfied.
42+
## Again, only one of "branch", "version" or "revision" can be specified.
43+
# version = "1.0.0"
44+
# branch = "master"
45+
# revision = "abc123"
46+
#
47+
## Optional: specifying an alternate source location as an override will
48+
## enforce that the alternate location is used for that project, regardless of
49+
## what source location any dependent projects specify.
50+
# source = "https://github.com/myfork/package.git"
51+
52+
53+
254
[[dependencies]]
355
name = "github.com/sdboyer/deptest"
456
version = ">=0.8.0, <1.0.0"

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,56 @@
11

2+
## Gopkg.toml example (these lines may be deleted)
3+
4+
## "required" lists a set of packages (not projects) that must be included in
5+
## Gopkg.lock. This list is merged with the set of packages imported by the current
6+
## project. Use it when your project needs a package it doesn't explicitly import -
7+
## including "main" packages.
8+
# required = ["github.com/user/thing/cmd/thing"]
9+
10+
## "ignored" lists a set of packages (not projects) that are ignored when
11+
## dep statically analyzes source code. Ignored packages can be in this project,
12+
## or in a dependency.
13+
# ignored = ["github.com/user/project/badpkg"]
14+
15+
## Dependencies define constraints on dependent projects. They are respected by
16+
## dep whether coming from the Gopkg.toml of the current project or a dependency.
17+
# [[dependencies]]
18+
## Required: the root import path of the project being constrained.
19+
# name = "github.com/user/project"
20+
#
21+
## Recommended: the version constraint to enforce for the project.
22+
## Only one of "branch", "version" or "revision" can be specified.
23+
# version = "1.0.0"
24+
# branch = "master"
25+
# revision = "abc123"
26+
#
27+
## Optional: an alternate location (URL or import path) for the project's source.
28+
# source = "https://github.com/myfork/package.git"
29+
30+
## Overrides have the same structure as [[dependencies]], but supercede all
31+
## [[dependencies]] declarations from all projects. Only the current project's
32+
## [[overrides]] are applied.
33+
##
34+
## Overrides are a sledgehammer. Use them only as a last resort.
35+
# [[overrides]]
36+
## Required: the root import path of the project being constrained.
37+
# name = "github.com/user/project"
38+
#
39+
## Optional: specifying a version constraint override will cause all other
40+
## constraints on this project to be ignored; only the overriden constraint
41+
## need be satisfied.
42+
## Again, only one of "branch", "version" or "revision" can be specified.
43+
# version = "1.0.0"
44+
# branch = "master"
45+
# revision = "abc123"
46+
#
47+
## Optional: specifying an alternate source location as an override will
48+
## enforce that the alternate location is used for that project, regardless of
49+
## what source location any dependent projects specify.
50+
# source = "https://github.com/myfork/package.git"
51+
52+
53+
254
[[dependencies]]
355
branch = "master"
456
name = "github.com/sdboyer/deptest"

0 commit comments

Comments
 (0)