diff --git a/result.go b/result.go index 4fe891e..b32063b 100644 --- a/result.go +++ b/result.go @@ -97,7 +97,7 @@ func (r *Result) MustScan(cnt int, dest ...interface{}) error { return err } if cnt != r.scanCount { - return errors.New(fmt.Sprintf("Worng scan count, expected %d, actual %d.", cnt, r.scanCount)) + return errors.New(fmt.Sprintf("Wrong scan count, expected %d, actual %d.", cnt, r.scanCount)) } return nil } @@ -145,7 +145,7 @@ func (r *Result) scanStruct(s *reflect.Value) error { if f.IsValid() { if f.CanSet() { if err := convertAssign(f.Addr().Interface(), r.Rows[r.currentRow][i]); err != nil { - return err + return fmt.Errorf("%s, column '%s'", err.Error(), col.Name) } r.scanCount++ } diff --git a/sp_result.go b/sp_result.go index 64c6c8f..8bfba8a 100644 --- a/sp_result.go +++ b/sp_result.go @@ -89,7 +89,7 @@ func (r *SpResult) Next() bool { return rst.Next() } -//Sacaning output parameters of stored procedure +//Scanning output parameters of stored procedure func (r *SpResult) ParamScan(values ...interface{}) error { outputValues := make([]interface{}, len(r.outputParams)) for i := 0; i < len(r.outputParams); i++ {