ConverAssignRowNullable is the same as ConvertAssignRow except that it allows nil as a value for the row or any of the row values. In thoses cases, the corresponding values are ignored.
(row []Value, dest ...interface{})
| 266 | // nil as a value for the row or any of the row values. In thoses cases, the |
| 267 | // corresponding values are ignored. |
| 268 | func ConvertAssignRowNullable(row []Value, dest ...interface{}) error { |
| 269 | if len(row) != len(dest) { |
| 270 | return errors.Newf( |
| 271 | "# of row entries %d does not match # of destinations %d", |
| 272 | len(row), |
| 273 | len(dest)) |
| 274 | } |
| 275 | |
| 276 | if row == nil { |
| 277 | return nil |
| 278 | } |
| 279 | |
| 280 | for i := 0; i < len(row); i++ { |
| 281 | if row[i].IsNull() { |
| 282 | continue |
| 283 | } |
| 284 | |
| 285 | err := ConvertAssign(row[i], dest[i]) |
| 286 | if err != nil { |
| 287 | return err |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | return nil |
| 292 | } |
| 293 | |
| 294 | // ConvertAssignRow copies a row of values in the list of destinations. An |
| 295 | // error is returned if any one of the row's element coping is done between |
nothing calls this directly
no test coverage detected