Skip to content

Instantly share code, notes, and snippets.

View cihangir's full-sized avatar
💭
Closed sourcing

Cihangir cihangir

💭
Closed sourcing
View GitHub Profile
@cihangir
cihangir / reflect.switch.go
Created May 30, 2013 07:52
switch / reflect Go
//get type of current value
typeOfKey := reflect.TypeOf(v).String()
//every v, will be a string at the end
switch typeOfKey {
//if we have an complex type, resolve it
case "map[string]interface {}":
//convert value to its real type