L
L
levisl2015-06-11 14:33:00
MySQL
levisl, 2015-06-11 14:33:00

Why does a go program not see the structure from the included library?

There is "database/sql"
Next, I want to import data from the database with a query. First tried in a thong, got

Scan error on column index 8: unsupported driver -> Scan pair: <nil> -> *string

Googling and reading the documentation, I found out6 that the NullString type is described for these operations, with which rows.Scan already works.
But, when trying to describe a variable as Nullstring
./main.go:33: undefined: NullString

That's how it is, I'm not catching up. I even checked libexec/src/database/sql/sql.go, everything is described there.
Please help, my head is spinning.
PS using the mymysql driver I want to read the query result into an array of structures

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lelvisl, 2015-06-11
@lelvisl

tupanul himself, 2 nights without sleep. Should have written sql.NullString

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question