Skip to content

Instantly share code, notes, and snippets.

@peterellisjones
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterellisjones/0736beefd2c18a192eb9 to your computer and use it in GitHub Desktop.
Save peterellisjones/0736beefd2c18a192eb9 to your computer and use it in GitHub Desktop.
Line 19 Compiles with Go 1.3.3
package main
import "fmt"
type poolJSON struct {
Clusters []clusterJSON `json:"clusters"`
}
type clusterJSON struct {
InstanceID string `json:"instance_id"`
}
func main() {
poolJ := poolJSON{}
poolJ2 := poolJSON{}
clusterJ := clusterJSON{InstanceID: "foobar"}
poolJ.Clusters = append(poolJ, clusterJ)
poolJ2.Clusters = append(poolJ2.Clusters, clusterJ)
fmt.Printf("%T\t%+v\n", poolJ.Clusters, poolJ.Clusters)
fmt.Printf("%T\t%+v\n", poolJ2.Clusters, poolJ2.Clusters)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment