MCPcopy Create free account
hub / github.com/abiosoft/mold / hasExt

Function hasExt

engine.go:257–270  ·  view source on GitHub ↗
(exts []string, ext string)

Source from the content-addressed store, hash-verified

255}
256
257func hasExt(exts []string, ext string) bool {
258 if ext == "" {
259 return false
260 }
261 sanitize := func(ext string) string {
262 return strings.ToLower(strings.TrimPrefix(ext, "."))
263 }
264 for _, e := range exts {
265 if sanitize(e) == sanitize(ext) {
266 return true
267 }
268 }
269 return false
270}
271
272func validateLayoutFile(exts []string, name string) error {
273 ext := filepath.Ext(name)

Callers 4

walkFunction · 0.85
validateLayoutFileFunction · 0.85
OpenMethod · 0.85
TestValidExtFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestValidExtFunction · 0.68