Codebase list golang-github-kylelemons-godebug / 95b3824
Change the argument names of pretty.Compare to a and b Ken Bloom 7 years ago
1 changed file(s) with 9 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
133133 }
134134
135135 // 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.
137137 //
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)
143144 }
144145
145146 // Compare returns a string containing a line-by-line unified diff of the
146147 // 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 {
148149 diffCfg := *cfg
149150 diffCfg.Diffable = true
150 return diff.Diff(cfg.Sprint(got), cfg.Sprint(want))
151 return diff.Diff(cfg.Sprint(a), cfg.Sprint(b))
151152 }