Change the argument names of pretty.Compare to a and b
Ken Bloom
7 years ago
133 | 133 | } |
134 | 134 | |
135 | 135 | // Compare returns a string containing a line-by-line unified diff of the |
136 | // values in got and want, using the CompareConfig. | |
136 | // values in a and b, using the CompareConfig. | |
137 | 137 | // |
138 | // Each line in the output is prefixed with '+', '-', or ' ' to indicate if it | |
139 | // should be added to, removed from, or is correct for the "got" value with | |
140 | // respect to the "want" value. | |
141 | func Compare(got, want interface{}) string { | |
142 | return CompareConfig.Compare(got, want) | |
138 | // Each line in the output is prefixed with '+', '-', or ' ' to indicate which | |
139 | // side it's from. Lines from the a side are marked with a '-', lines from the | |
140 | // b side are marked with a '+' and lines that are the same on both sides are | |
141 | // marked with a ' '. | |
142 | func Compare(a, b interface{}) string { | |
143 | return CompareConfig.Compare(a, b) | |
143 | 144 | } |
144 | 145 | |
145 | 146 | // Compare returns a string containing a line-by-line unified diff of the |
146 | 147 | // values in got and want according to the cfg. |
147 | func (cfg *Config) Compare(got, want interface{}) string { | |
148 | func (cfg *Config) Compare(a, b interface{}) string { | |
148 | 149 | diffCfg := *cfg |
149 | 150 | diffCfg.Diffable = true |
150 | return diff.Diff(cfg.Sprint(got), cfg.Sprint(want)) | |
151 | return diff.Diff(cfg.Sprint(a), cfg.Sprint(b)) | |
151 | 152 | } |