~rogpeppe/gocheck/add-list-flag

« back to all changes in this revision

Viewing changes to checkers.go

  • Committer: Gustavo Niemeyer
  • Author(s): Roger Peppe
  • Date: 2011-12-13 21:11:04 UTC
  • mfrom: (61.1.4 gocheck)
  • Revision ID: gustavo@niemeyer.net-20111213211104-zhqnf20wnu3bwk12
Fix errors to print their string values.

Also, fmt.Stringer is a more conventional interface
type than hasString.

R=
CC=
https://codereview.appspot.com/5418043

Show diffs side-by-side

added added

removed removed

Lines of Context:
231
231
        }
232
232
        valueStr, valueIsStr := value.(string)
233
233
        if !valueIsStr {
234
 
                if valueWithStr, valueHasStr := value.(hasString); valueHasStr {
 
234
                if valueWithStr, valueHasStr := value.(fmt.Stringer); valueHasStr {
235
235
                        valueStr, valueIsStr = valueWithStr.String(), true
236
236
                }
237
237
        }