// WriteSqls write sqls to file
WriteSqls write sqls to file
// WriteSqls write sqls to file
func (df *Diff) WriteSqls() {
	for {
		select {
		case dml, ok := <-df.sqlCh:
			if !ok || dml == "end" {
				return
			}
			_, err := df.fixSQLFile.WriteString(fmt.Sprintf("%s\n", dml))
			if err != nil {
				log.Errorf("write sql: %s failed, error: %v", dml, err)
			}
			df.wg.Done()
		case <-df.ctx.Done():
			return
		}
	}
}
func ( df * Diff ) WriteSqls ( ) { for { select { case dml , ok := <- df . sqlCh : if ! ok || dml == " " { return } _ , err := df . fixSQLFile . WriteString ( fmt . Sprintf ( " \n " , dml ) ) if err != nil { log . Errorf ( " " , dml , err ) } df . wg . Done ( ) case <- df . ctx . Done ( ) : return } } }
WriteSqls write sqls to file
WriteSqls write sqls to file