// String returns a string of this Report.
String returns a string of this Report.
// String returns a string of this Report .
func (r *Report) String() (report string) {
	r.RLock()
	defer r.RUnlock()
	report = fmt.Sprintf("\ncheck result of schema %s: %s!\n", r.Schema, r.Result)
	report += fmt.Sprintf("%d tables' check passed, %d tables' check failed.\n", r.PassNum, r.FailedNum)
	var failTableRsult, passTableResult string
	for table, result := range r.TableResults {
		var structResult, dataResult string
		if !result.StructEqual {
			structResult = "table's struct not equal"
		} else {
			structResult = "table's struct equal"
		}
		if !result.DataEqual {
			dataResult = "table's data not equal"
		} else {
			dataResult = "table's data equal"
		}
		if !result.StructEqual || !result.DataEqual {
			failTableRsult = fmt.Sprintf("%stable: %s\n%s\n%s\n\n", failTableRsult, table, structResult, dataResult)
		} else {
			passTableResult = fmt.Sprintf("%stable: %s\n%s\n%s\n\n", passTableResult, table, structResult, dataResult)
		}
	}
	report += fmt.Sprintf("\n%s%s", failTableRsult, passTableResult)
	return
}
func ( r * Report ) String ( ) ( report string ) { r . RLock ( ) defer r . RUnlock ( ) report = fmt . Sprintf ( " \n \n " , r . Schema , r . Result ) report += fmt . Sprintf ( " \n " , r . PassNum , r . FailedNum ) var failTableRsult , passTableResult string for table , result := range r . TableResults { var structResult , dataResult string if ! result . StructEqual { structResult = " " } else { structResult = " " } if ! result . DataEqual { dataResult = " " } else { dataResult = " " } if ! result . StructEqual || ! result . DataEqual { failTableRsult = fmt . Sprintf ( " \n \n \n \n " , failTableRsult , table , structResult , dataResult ) } else { passTableResult = fmt . Sprintf ( " \n \n \n \n " , passTableResult , table , structResult , dataResult ) } } report += fmt . Sprintf ( " \n " , failTableRsult , passTableResult ) return }
String returns a string of this Report.
String returns a string of this Report .
/*
		output example:
		check result of schema test: fail!
		1 tables' check passed, 2 tables' check failed.

		table: test1
		table's struct equal
		table's data not equal

		table: test2
		table's struct equal
		table's data not equal

		table: test3
		table's struct equal
		table's data equal
	*/ // first print the check failed table's information