I'm getting the following error
Cannot use '"No 3A4"' (type string) as type *string in assignment
How can I add a default value for the query doesn't return rows so I can't use the row.Scan() function, sample code below.
func (orders *Orders) getOrderStatus() {
var err error
for _, order := range *orders {
row := db.QueryRow("SELECT status FROM mss_orders WHERE externalorderkey = ? ORDER BY tipo ASC LIMIT 1", order.PoNumber)
err = row.Scan(&order.Status)
if err != nil {
&order.Status = "No 3A4" <----- How can I do this?
}
fmt.Printf("%+v
", order)
}
}