mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00
20 lines
245 B
Go
20 lines
245 B
Go
package gitutil
|
|
|
|
func IsCommitSHA(str string) bool {
|
|
if len(str) != 40 {
|
|
return false
|
|
}
|
|
|
|
for _, ch := range str {
|
|
if ch >= '0' && ch <= '9' {
|
|
continue
|
|
}
|
|
if ch >= 'a' && ch <= 'f' {
|
|
continue
|
|
}
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|