GetModuleName returns a module's name (the last label of its ID) from an instance of its value. If the value is not a module, an empty string will be returned.
(instance any)
| 175 | // from an instance of its value. If the value is not a module, an |
| 176 | // empty string will be returned. |
| 177 | func GetModuleName(instance any) string { |
| 178 | var name string |
| 179 | if mod, ok := instance.(Module); ok { |
| 180 | name = mod.CaddyModule().ID.Name() |
| 181 | } |
| 182 | return name |
| 183 | } |
| 184 | |
| 185 | // GetModuleID returns a module's ID from an instance of its value. |
| 186 | // If the value is not a module, an empty string will be returned. |
nothing calls this directly
no test coverage detected