NamespacedName converts a namespace and name to a C-compatible format. E.g., namespace "Go\Extension" and name "MyClass" become "Go_Extension_MyClass". This symbol remains exported, so it's usable in templates.
(namespace, name string)
| 23 | // E.g., namespace "Go\Extension" and name "MyClass" become "Go_Extension_MyClass". |
| 24 | // This symbol remains exported, so it's usable in templates. |
| 25 | func NamespacedName(namespace, name string) string { |
| 26 | if namespace == "" { |
| 27 | return name |
| 28 | } |
| 29 | namespacePart := strings.ReplaceAll(namespace, `\`, "_") |
| 30 | return namespacePart + "_" + name |
| 31 | } |
| 32 | |
| 33 | // EXPERIMENTAL |
| 34 | func SanitizePackageName(name string) string { |
no outgoing calls