Skip to content

Commit

Permalink
fix package-spec in README.md
Browse files Browse the repository at this point in the history
Fix the package-spec in README.md so that it's not confusing to users
and add a test to verify the parsing of a full package spec with a path,
/^, origin, and version.
  • Loading branch information
bhcleek authored and kardianos committed Jun 5, 2018
1 parent c3e856d commit 9a2e603
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Status can be logically composed:
## Package specifier

The full package-spec is:
`<path>[::<origin>][{/...|/^}][@[<version-spec>]]`
`<path>[{/...|/^}][::<origin>][@[<version-spec>]]`

Some examples:

Expand Down
1 change: 1 addition & 0 deletions pkgspec/pkgspec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func TestParse(t *testing.T) {
{Spec: "abc/def::foo/bar/vendor/abc/def"},
{Spec: "abc/def::foo/bar/vendor/abc/def@"},
{Spec: "abc/def::foo/bar/vendor/abc/[email protected]", Pkg: &Pkg{Path: "abc/def", HasOrigin: true, Origin: "foo/bar/vendor/abc/def", HasVersion: true, Version: "v1.2.3"}},
{Spec: "abc/def/^::foo/bar/vendor/abc/[email protected]", Pkg: &Pkg{Path: "abc/def", IncludeTree: true, HasOrigin: true, Origin: "foo/bar/vendor/abc/def", HasVersion: true, Version: "v1.2.3"}},
{Spec: "abc/def@", Pkg: &Pkg{Path: "abc/def", HasVersion: true}},
{Spec: "abc/[email protected]", Pkg: &Pkg{Path: "abc/def", HasVersion: true, Version: "v1.2.3"}},
{Spec: "./[email protected]", Str: "abc/[email protected]", Pkg: &Pkg{Path: "abc/def", HasVersion: true, Version: "v1.2.3"}, WD: "abc/"},
Expand Down

0 comments on commit 9a2e603

Please sign in to comment.