MCPcopy Create free account
hub / github.com/codehamr/codehamr / isHex

Function isHex

cmd/codehamr/main.go:146–156  ·  view source on GitHub ↗

isHex reports whether s is non-empty lowercase hex, the shape of a git abbreviated commit hash.

(s string)

Source from the content-addressed store, hash-verified

144// isHex reports whether s is non-empty lowercase hex, the shape of a git
145// abbreviated commit hash.
146func isHex(s string) bool {
147 if s == "" {
148 return false
149 }
150 for _, r := range s {
151 if (r < '0' || r > '9') && (r < 'a' || r > 'f') {
152 return false
153 }
154 }
155 return true
156}
157
158// maybeSelfUpdate runs the pre-launch auto-update. No-op for local builds,
159// an already-current hash, an unsupported platform (see update.assetName),

Callers 1

isLocalBuildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected