-
- type ComplexStruct struct {
- Name string
- Age uint
- Metadata map[string]interface{}
- }
-
- v := ComplexStruct{
- Name: "mitchellh",
- Age: 64,
- Metadata: map[string]interface{}{
- "car": true,
- "location": "California",
- "siblings": []string{"Bob", "John"},
- },
- }
-
- hash, err := hashstructure.Hash(v, nil)
- if err != nil {
- panic(err)
- }
-
- fmt.Printf("%d", hash)
- // Output:
- // 2307517237273902113
+```go
+type ComplexStruct struct {
+ Name string
+ Age uint
+ Metadata map[string]interface{}
+}
+
+v := ComplexStruct{
+ Name: "mitchellh",
+ Age: 64,
+ Metadata: map[string]interface{}{
+ "car": true,
+ "location": "California",
+ "siblings": []string{"Bob", "John"},
+ },
+}
+
+hash, err := hashstructure.Hash(v, nil)
+if err != nil {
+ panic(err)
+}
+
+fmt.Printf("%d", hash)
+// Output:
+// 2307517237273902113
+```