Skip to content

Commit 8c47e87

Browse files
committed
Run gofumpt -l -w .
1 parent 0599a27 commit 8c47e87

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

hashstructure.go

+16-18
Original file line numberDiff line numberDiff line change
@@ -72,29 +72,28 @@ const (
7272
//
7373
// Notes on the value:
7474
//
75-
// * Unexported fields on structs are ignored and do not affect the
75+
// - Unexported fields on structs are ignored and do not affect the
7676
// hash value.
7777
//
78-
// * Adding an exported field to a struct with the zero value will change
78+
// - Adding an exported field to a struct with the zero value will change
7979
// the hash value.
8080
//
8181
// For structs, the hashing can be controlled using tags. For example:
8282
//
83-
// struct {
84-
// Name string
85-
// UUID string `hash:"ignore"`
86-
// }
83+
// struct {
84+
// Name string
85+
// UUID string `hash:"ignore"`
86+
// }
8787
//
8888
// The available tag values are:
8989
//
90-
// * "ignore" or "-" - The field will be ignored and not affect the hash code.
90+
// - "ignore" or "-" - The field will be ignored and not affect the hash code.
9191
//
92-
// * "set" - The field will be treated as a set, where ordering doesn't
93-
// affect the hash code. This only works for slices.
94-
//
95-
// * "string" - The field will be hashed as a string, only works when the
96-
// field implements fmt.Stringer
92+
// - "set" - The field will be treated as a set, where ordering doesn't
93+
// affect the hash code. This only works for slices.
9794
//
95+
// - "string" - The field will be hashed as a string, only works when the
96+
// field implements fmt.Stringer
9897
func Hash(v interface{}, format Format, opts *HashOptions) (uint64, error) {
9998
// Validate our format
10099
if format <= formatInvalid || format >= formatMax {
@@ -422,7 +421,6 @@ func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) {
422421
default:
423422
return 0, fmt.Errorf("unknown kind to hash: %s", k)
424423
}
425-
426424
}
427425

428426
func hashUpdateOrdered(h hash.Hash64, a, b uint64) uint64 {
@@ -453,11 +451,11 @@ func hashUpdateUnordered(a, b uint64) uint64 {
453451
// hashUpdateUnordered can effectively cancel out a previous change to the hash
454452
// result if the same hash value appears later on. For example, consider:
455453
//
456-
// hashUpdateUnordered(hashUpdateUnordered("A", "B"), hashUpdateUnordered("A", "C")) =
457-
// H("A") ^ H("B")) ^ (H("A") ^ H("C")) =
458-
// (H("A") ^ H("A")) ^ (H("B") ^ H(C)) =
459-
// H(B) ^ H(C) =
460-
// hashUpdateUnordered(hashUpdateUnordered("Z", "B"), hashUpdateUnordered("Z", "C"))
454+
// hashUpdateUnordered(hashUpdateUnordered("A", "B"), hashUpdateUnordered("A", "C")) =
455+
// H("A") ^ H("B")) ^ (H("A") ^ H("C")) =
456+
// (H("A") ^ H("A")) ^ (H("B") ^ H(C)) =
457+
// H(B) ^ H(C) =
458+
// hashUpdateUnordered(hashUpdateUnordered("Z", "B"), hashUpdateUnordered("Z", "C"))
461459
//
462460
// hashFinishUnordered "hardens" the result, so that encountering partially
463461
// overlapping input data later on in a different context won't cancel out.

hashstructure_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ func TestHash_equalIgnore(t *testing.T) {
262262
},
263263
{
264264
TestTime2{Name: "foo", Time: now},
265-
TestTime2{Name: "foo", Time: time.Date(now.Year(), now.Month(), now.Day(), now.Hour(),
266-
now.Minute(), now.Second(), now.Nanosecond(), now.Location()),
265+
TestTime2{
266+
Name: "foo", Time: time.Date(now.Year(), now.Month(), now.Day(), now.Hour(),
267+
now.Minute(), now.Second(), now.Nanosecond(), now.Location()),
267268
},
268269
true,
269270
},

0 commit comments

Comments
 (0)