diff options
author | Ross Light <light@google.com> | 2018-08-23 11:22:46 -0700 |
---|---|---|
committer | Joe Tsai <joetsai@digital-static.net> | 2018-08-23 11:22:46 -0700 |
commit | 2006917edc5a27cd174dbc4baba31a137d6cb9ff (patch) | |
tree | eb1f939f425012079fea6ea3cf72e94b204667ba /cmp | |
parent | 5411ab924f9ffa6566244a9e504bc347edacffd3 (diff) | |
download | go-cmp-2006917edc5a27cd174dbc4baba31a137d6cb9ff.tar.gz |
Swap order of want and got in Diff example (#91)
Most usages of Diff do so with "-want +got" instead of "-got +want".
Change the example to reflect the present reality.
Diffstat (limited to 'cmp')
-rw-r--r-- | cmp/example_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmp/example_test.go b/cmp/example_test.go index 67ead5b..5507e0b 100644 --- a/cmp/example_test.go +++ b/cmp/example_test.go @@ -92,12 +92,12 @@ func ExampleDiff_testing() { for _, test := range tests { AddCrew(test.before, test.name, test.title) if diff := cmp.Diff(test.before, test.after); diff != "" { - t.Errorf("%s: after AddCrew, manifest differs: (-got +want)\n%s", test.desc, diff) + t.Errorf("%s: after AddCrew, manifest differs: (-want +got)\n%s", test.desc, diff) } } // Output: - // add to empty: after AddCrew, manifest differs: (-got +want) + // add to empty: after AddCrew, manifest differs: (-want +got) // {*cmp_test.ShipManifest}.Crew["Galactic President"]: // -: "Zaphod Beeblebrox" // +: <non-existent> @@ -105,7 +105,7 @@ func ExampleDiff_testing() { // -: <non-existent> // +: "Galactic President" // - // add another: after AddCrew, manifest differs: (-got +want) + // add another: after AddCrew, manifest differs: (-want +got) // {*cmp_test.ShipManifest}.Crew["Human"]: // -: "Trillian" // +: <non-existent> @@ -113,7 +113,7 @@ func ExampleDiff_testing() { // -: <non-existent> // +: "Human" // - // overwrite: after AddCrew, manifest differs: (-got +want) + // overwrite: after AddCrew, manifest differs: (-want +got) // {*cmp_test.ShipManifest}.Crew["Just this guy, you know?"]: // -: "Zaphod Beeblebrox" // +: <non-existent> |