src-d/go-git · section.go
go logo
func (s *Section) IsName(name string) bool {
	return strings.ToLower(s.Name) == strings.ToLower(name)
}
Similar code snippets
1.
opennota/check · varcheck.go
Match rating: 65.24% · See similar code snippets
go logo
func isReserved(name string) bool {
	return name == "_" || strings.HasPrefix(strings.ToLower(name), "_cgo_")
}
2.
smolgu/lib · markdown.go
Match rating: 59.16% · See similar code snippets
go logo
func IsReadmeFile(name string) bool {
	name = strings.ToLower(name)
	if len(name) < 6 {
		return false
	} else if len(name) == 6 {
		if name == "readme" {
			return true
		}
		return false
	}
	if name[:7] == "readme." {
		return true
	}
	return false
}
3.
JamesClonk/vultr · servers.go
Match rating: 58.44% · See similar code snippets
go logo
func (s servers) Less(i, j int) bool {
	// sort order: name, ip
	if strings.ToLower(s[i].Name) < strings.ToLower(s[j].Name) {
		return true
	} else if strings.ToLower(s[i].Name) > strings.ToLower(s[j].Name) {
		return false
	}
	return s[i].MainIP < s[j].MainIP
}
4.
ardielle/ardielle-go · types.go
Match rating: 58.12% · See similar code snippets
go logo
func (reg *typeRegistry) IsBaseTypeName(name TypeRef) bool {
	if name != "" {
		lower := strings.ToLower(string(name))
		for _, n := range namesBaseType {
			if lower == strings.ToLower(n) {
				return true
			}
		}
	}
	return false
}
5.
ghetzel/pivot · file_backend.go
Match rating: 57.27% · See similar code snippets
go logo
func (self *FileBackend) normcol(name string) string {
	name = strings.TrimSpace(name)
	name = strings.ToLower(name)
	name = strings.TrimFunc(name, func(r rune) bool {
		if unicode.IsLetter(r) || unicode.IsNumber(r) {
			return false
		} else {
			return true
		}
	})

	return name
}
6.
JamesClonk/vultr · sshkeys.go
Match rating: 56.98% · See similar code snippets
go logo
func (s sshkeys) Less(i, j int) bool { return strings.ToLower(s[i].Name) < strings.ToLower(s[j].Name) }
7.
kubernetes/gengo · namer.go
Match rating: 56.78% · See similar code snippets
go logo
func IsPrivateGoName(name string) bool {
	return len(name) == 0 || strings.ToLower(name[:1]) == name[:1]
}
8.
gogs/gogs · user.go
Match rating: 56.09% · See similar code snippets
go logo
func IsUserExist(uid int64, name string) (bool, error) {
	if len(name) == 0 {
		return false, nil
	}
	return x.Where("id != ?", uid).Get(&User{LowerName: strings.ToLower(name)})
}
9.
smolgu/lib · markdown.go
Match rating: 55.7% · See similar code snippets
go logo
func IsMarkdownFile(name string) bool {
	name = strings.ToLower(name)
	switch filepath.Ext(name) {
	case ".md", ".markdown", ".mdown", ".mkd":
		return true
	}
	return false
}
10.
uber-go/dosa · names.go
Match rating: 55.63% · See similar code snippets
go logo
func NormalizeName(name string) (string, error) {
	lowercaseName := strings.ToLower(strings.TrimSpace(name))
	if err := IsValidName(lowercaseName); err != nil {
		return "", errors.Wrapf(err, "failed to normalize to a valid name for %s", name)
	}
	return lowercaseName, nil
}