I'm using Go 1.9 and see that nowhere does it prescribe me to use the following syntax
func main() {
dsn := DB_USER + ":" + DB_PASS + "@" + DB_HOST + "/" + DB_NAME + "?charset=utf8"
db, err := sql.Open("mysql", dsn)
if err != nil {
log.Fatal(err)
}
defer db.Close()
q := "call regWorker('Thuto', 'Deere4454de', '[email protected]', '8725554675364', '94874256443', @outarg)"
_, err = db.Exec(q)
if err != nil {
log.Fatal(err)
}'
What I found odd is that it actually registers the worker? My problem is that I need the @outarg value and I'm not 100% sure how to retrieve it. I'd like to rewrite this code to be in line with the go-sql as explained here https://golang.org/pkg/database/sql/#Out
I tried searching and I humbly apologise if this has been explained before.
edit: I'm very new to go