wfc-server/common/misc.go
2026-04-01 00:38:31 -04:00

17 lines
385 B
Go

package common
import "reflect"
func UNUSED(v ...interface{}) {
}
func ReverseMap(m interface{}) interface{} {
inputType := reflect.TypeOf(m)
inputValue := reflect.ValueOf(m)
result := reflect.MakeMap(reflect.MapOf(inputType.Elem(), inputType.Key()))
for _, key := range inputValue.MapKeys() {
result.SetMapIndex(inputValue.MapIndex(key), key)
}
return result.Interface()
}