My guess is that r.Referer
(Type func
) in stmt.Query
should be r.Referer()
(Returns type string
, From net/http
).
So the line should read:
stmtRows, stmtRowsErr := stmt.Query(xaid, subtag, r.Referer(), requestUserAgent, requestIP, ip, ua, title, description, displayurl, clickUrl, kw, rpc, exid)
That error is coming from Line #37 of convert.go
in the database/sql
package.
It's telling you that the type conversion for argument #2 (zero indexed) of the SQL query couldn't be converted into the type expected by the SQL engine (In particular the function driver.DefaultParameterConverter.ConvertValue(arg)
failed.)
Check the types for each variable in your query with something like:
fmt.Printf("%T %T %T %T %T %T %T %T %T %T %T %T %T %T", xaid, subtag, r.Referer, requestUserAgent, requestIP, ip, ua, title, description, displayurl, clickUrl, kw, rpc, exid)
and see if any of them are unexpected or incorrect.