// foldName returns a folded string such that foldName(x) == foldName(y) // is similar to strings.EqualFold(x, y), but ignores underscore and dashes. // This allows foldName to match common naming conventions. func foldName(in []byte) []byte { … } func appendFoldedName(out, in []byte) []byte { … } // foldRune is a variation on unicode.SimpleFold that returns the same rune // for all runes in the same fold set. // // Invariant: // // foldRune(x) == foldRune(y) ⇔ strings.EqualFold(string(x), string(y)) func foldRune(r rune) rune { … }