Home > Article > Backend Development > Why Am I Getting a "panic: sql: expected 1 destination arguments in Scan, not " Error When Scanning JSONB Data in Go?
"Panic" of Unexpected Scan Destination Arguments in Go with PostgreSQL JSONB
In a scenario where you're attempting to retrieve records with JSONB data from a PostgreSQL database in Go, you may encounter the enigmatic "panic: sql: expected 1 destination arguments in Scan, not
The heart of this issue lies in the number of destination arguments specified in your Scan() function. Suppose you've declared a Message struct to hold the retrieved data. The offending code likely attempts to scan multiple fields, such as m.Id, m.Type, and m.
The above is the detailed content of Why Am I Getting a "panic: sql: expected 1 destination arguments in Scan, not " Error When Scanning JSONB Data in Go?. For more information, please follow other related articles on the PHP Chinese website!