diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/example/example.go | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/internal/example/example.go b/internal/example/example.go index e828c05..90f861a 100644 --- a/internal/example/example.go +++ b/internal/example/example.go @@ -115,6 +115,22 @@ func referenceCompare(fileStr string) (err error) {  // error is not nil, its String() value is printed to standard output.  func Summary(err error, fileStr string) {  	if err == nil { +		fileStr = filepath.ToSlash(fileStr) +		fmt.Printf("Successfully generated %s\n", fileStr) +	} else { +		fmt.Println(err) +	} +} + +// SummaryCompare generates a predictable report for use by test examples. If +// the specified error is nil, the generated file is compared with a reference +// copy for byte-for-byte equality. If the files match, then the filename +// delimiters are normalized and the filename printed to standard output with a +// success message. If the files do not match, this condition is reported on +// standard output. If the specified error is not nil, its String() value is +// printed to standard output. +func SummaryCompare(err error, fileStr string) { +	if err == nil {  		err = referenceCompare(fileStr)  	}  	if err == nil { | 
