Skip to content

Commit

Permalink
Added another column name to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Songhurst committed Sep 27, 2017
1 parent f3998c8 commit e79e30e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions result.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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++
}
Expand Down
2 changes: 1 addition & 1 deletion sp_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand Down

0 comments on commit e79e30e

Please sign in to comment.