1 Star 1 Fork 0

bigbase / pg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
tag.go 566 Bytes
一键复制 编辑 原始数据 按行查看 历史
package orm
import (
"bytes"
"strings"
)
type tagOptions string
func (o tagOptions) Get(name string) (string, bool) {
s := string(o)
for len(s) > 0 {
var next string
idx := strings.IndexByte(s, ',')
if idx >= 0 {
s, next = s[:idx], s[idx+1:]
}
if strings.HasPrefix(s, name) {
return s[len(name):], true
}
s = next
}
return "", false
}
func parseTag(tagStr string) (string, tagOptions) {
tag := []byte(tagStr)
if idx := bytes.IndexByte(tag, ','); idx != -1 {
return string(tag[:idx]), tagOptions(tag[idx+1:])
}
return tagStr, ""
}
Go
1
https://gitee.com/bigbase/pg.git
git@gitee.com:bigbase/pg.git
bigbase
pg
pg
v6.0.3

搜索帮助