Skip to content

Instantly share code, notes, and snippets.

@technosophos
Last active December 10, 2015 02:48
Show Gist options
  • Save technosophos/4370024 to your computer and use it in GitHub Desktop.
Save technosophos/4370024 to your computer and use it in GitHub Desktop.
package main;
import (
"fmt"
);
func main() {
var m = make(map[string]interface{})
mf := new(MonkeyFace)
mf.foo = 128
mf.bar = "Go is awesome"
m["Test1"] = 1234
m["test2"] = "test"
passToInterface(m, 32)
m["monkey"] = mf
fmt.Println(m["myKey"])
fmt.Println(m["monkey"])
}
func passToInterface(m map[string]interface{}, s interface{}) {
m["myKey"] = s
}
type MonkeyFace struct {
foo int
bar string
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment