コード例 #1
0
ファイル: semantic.go プロジェクト: carlosjhr64/semantic
func mnbc(version *string) (int, int, int, string) {
	a := strings.SplitN(*version, ".", 4)
	if len(a) < 3 {
		to.Oops(version, "MNBC Version")
	}
	major := to.Int(&a[0])
	minor := to.Int(&a[1])
	build := to.Int(&a[2])
	comment := ""
	if len(a) == 4 {
		comment = a[3]
	}
	return major, minor, build, comment
}
コード例 #2
0
ファイル: semantic.go プロジェクト: carlosjhr64/semantic
// semantic.Likes(to.VERSION, "to-0.2.0")
func Likes(version string, match string) {
	pkgreq := strings.SplitN(match, "-", 2)
	pkg, req := pkgreq[0], pkgreq[1]
	w := strings.SplitN(req, ".", 3)
	i := make([]int, len(w))
	for j, n := range w {
		i[j] = to.Int(&n)
	}
	mustLike(&version, &pkg, i...)
}