Add HasCommand()
This commit is contained in:
parent
b852b02aed
commit
1643fef377
@ -45,3 +45,19 @@ func BuildURI(rawuri, rawpath string) string {
|
||||
u.Path = path.Join(u.Path, rawpath)
|
||||
return u.String()
|
||||
}
|
||||
|
||||
func HasCommand(s, prefix, cmd string) bool {
|
||||
if len(s) < 2 {
|
||||
return false
|
||||
}
|
||||
|
||||
if string(s[0]) != prefix {
|
||||
return false
|
||||
}
|
||||
|
||||
if s[1:] == cmd {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user