// check source and target position
check source and target position
// check source and target position
func (r *Rule) adjustColumnPosition(source, target int) (int, int, error) {
	if target == -1 {
		return source, target, errors.NotFoundf("target column %s", r.TargetColumn)
	}
	if r.Expression == Clone {
		if source == -1 {
			return source, target, errors.NotFoundf("source column %s", r.SourceColumn)
		}
		if target < source { 
			source--
		}
	}
	return source, target, nil
}
func ( r * Rule ) adjustColumnPosition ( source , target int ) ( int , int , error ) { if target == - 1 { return source , target , errors . NotFoundf ( " " , r . TargetColumn ) } if r . Expression == Clone { if source == - 1 { return source , target , errors . NotFoundf ( " " , r . SourceColumn ) } if target < source { source -- } } return source , target , nil }
check source and target position
check source and target position
// if not found target, ignore it // must add column and added column is before source column