You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gophi/gopher/regex.go

15 lines
370 B
Go

package gopher
import (
"gophi/core"
"regexp"
)
// gophermapRegex is the precompiled gophermap file name regex check
var gophermapRegex = regexp.MustCompile(`^(|.+/|.+\.)gophermap$`)
// isGophermap checks against gophermap regex as to whether a file path is a gophermap
func isGophermap(path *core.Path) bool {
return gophermapRegex.MatchString(path.Relative())
}