You can create a map of name -> struct "template"
When grabbing a value from a map, you get a copy of the value, the map effectively acts as a factory for your values.
Notice that the values from the map are unique.
In order to actually do something with the struct, you'll need to either assert its type or use some reflections based processor (ie: get struct from map, then json decode in to the struct)
Here's a simple Example with one struct in raw form and one pre-filled in.
Notice the type assertion on foowv1, that's so I can actually set the value.
package main
import "fmt"
type foo struct {
a int
}
var factory map[string]interface{} = map[string]interface{}{
"foo": foo{},
"foo.with.val": foo{2},
}
func main() {
foo1 := factory["foo"]
foo2 := factory["foo"]
fmt.Println("foo1", &foo1, foo1)
fmt.Println("foo2", &foo2, foo2)
foowv1 := factory["foo.with.val"].(foo)
foowv1.a = 123
foowv2 := factory["foo.with.val"]
fmt.Println("foowv1", &foowv1, foowv1)
fmt.Println("foowv2", &foowv2, foowv2)
}