1 Star 0 Fork 0

goproxies / github.com-kardianos-govendor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
pkg.go 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package pkgspec defines a schema that contains the path, origin, version
// and other properties.
package pkgspec
import "bytes"
type Pkg struct {
Path string
FilePath string
Origin string
IncludeTree bool
MatchTree bool
HasVersion bool
HasOrigin bool
Version string
Uncommitted bool
}
func (pkg *Pkg) String() string {
buf := &bytes.Buffer{}
buf.WriteString(pkg.Path)
if pkg.IncludeTree {
buf.WriteString(TreeIncludeSuffix)
} else if pkg.MatchTree {
buf.WriteString(TreeMatchSuffix)
}
if len(pkg.Origin) > 0 {
buf.WriteString(originMatch)
buf.WriteString(pkg.Origin)
}
if pkg.HasVersion {
buf.WriteString(versionMatch)
if len(pkg.Version) > 0 {
buf.WriteString(pkg.Version)
}
}
return buf.String()
}
func (pkg *Pkg) PathOrigin() string {
if len(pkg.Origin) > 0 {
return pkg.Origin
}
return pkg.Path
}
1
https://gitee.com/goproxies/github.com-kardianos-govendor.git
git@gitee.com:goproxies/github.com-kardianos-govendor.git
goproxies
github.com-kardianos-govendor
github.com-kardianos-govendor
v1.0.9

搜索帮助