]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/mitchellh/hashstructure/README.md
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / mitchellh / hashstructure / README.md
index 7d0de5bf5a69fb0b610266c3ab3f2eea6ccc73c7..28ce45a3e1813e9492c966cfa1494bec388304ae 100644 (file)
@@ -1,4 +1,4 @@
-# hashstructure
+# hashstructure [![GoDoc](https://godoc.org/github.com/mitchellh/hashstructure?status.svg)](https://godoc.org/github.com/mitchellh/hashstructure)
 
 hashstructure is a Go library for creating a unique hash value
 for arbitrary values in Go.
@@ -19,6 +19,9 @@ sending data across the network, caching values locally (de-dup), and so on.
 
   * Optionally specify a custom hash function to optimize for speed, collision
     avoidance for your data set, etc.
+  
+  * Optionally hash the output of `.String()` on structs that implement fmt.Stringer,
+    allowing effective hashing of time.Time
 
 ## Installation
 
@@ -34,28 +37,29 @@ For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/has
 
 A quick code example is shown below:
 
-
-       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
+```