diff options
Diffstat (limited to 'vendor/golang.org/x/mod')
-rw-r--r-- | vendor/golang.org/x/mod/module/module.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vendor/golang.org/x/mod/module/module.go b/vendor/golang.org/x/mod/module/module.go index 21f123957d..6cd37280a8 100644 --- a/vendor/golang.org/x/mod/module/module.go +++ b/vendor/golang.org/x/mod/module/module.go @@ -123,8 +123,12 @@ type Version struct { Version string `json:",omitempty"` } -// String returns the module version syntax Path@Version. +// String returns a representation of the Version suitable for logging +// (Path@Version, or just Path if Version is empty). func (m Version) String() string { + if m.Version == "" { + return m.Path + } return m.Path + "@" + m.Version } |