-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support github.com/foo/bar/v42
Support vendoring github.com/foo/bar/v42 like the following: `foo.go`: ```go package foo import ( "github.com/coreos/go-systemd/v22/dbus" ) func Foo() (*dbus.Conn, error) { return dbus.New() } ``` `vendor.conf`: ``` github.com/coreos/go-systemd/v22 v22.0.0 github.com/godbus/dbus/v5 v5.0.3 ``` Now `vndr` checks out the contents of `github.com/coreos/[email protected]` repo into the `./vendor/github.com/coreos/go-systemd/v22` directory. Note that `vndr` does not verify the actual version number written in `go.mod`. So `vndr github.com/coreos/go-systemd/v23 v22.0.0` would vendor v22, not v23. Fix containerd/cgroups#139 Signed-off-by: Akihiro Suda <[email protected]>
- Loading branch information
1 parent
d87a917
commit 781e3d6
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package versioned | ||
|
||
import ( | ||
"regexp" | ||
) | ||
|
||
var re = regexp.MustCompile(`/v[0-9]+$`) | ||
|
||
// IsVersioned true for string like "github.com/coreos/go-systemd/v22" | ||
func IsVersioned(s string) bool { | ||
return re.MatchString(s) | ||
} |