shad-go/lectures/07-sql/nulls/rows.go

13 lines
173 B
Go
Raw Normal View History

2020-04-08 19:20:23 +00:00
for rows.Next() {
var s sql.NullString
if err := rows.Scan(&s); err != nil {
log.Fatal(err)
}
if s.Valid {
//
} else {
//
}
}