Use reflect, in this example, we only show to unpack an int slice to a struct whose fields are all int type. package main import ( "errors" "fmt" "reflect" ) type Location struct { X int Y int Z int } func (loc Location) St...
Markdown supported · ⌘↵ to post
No responses yet.