Parse error in Golang while opening ODBC connection with Dremio

Viewed 98

I am getting error while opening ODBC connection to Dremio in Golang. Here is my code snippet:

connURL, _ := url.ParseRequestURI("http://dremio.abc.domain.com:32010/")
connString := fmt.Sprintf("%v://%v:%v@%v", connURL.Scheme, "user_name", "pass?word", connURL.Host)

conn, err := sql.Open("dremio", connString)

The error which I am getting is:

2022/04/20 18:07:05 parse "http://user_name:pass?word@dremio.abc.domain.com:32010": invalid port ":pass" after host exit status 1

This error doesn't appear if I remove '?' from the password. Can someone help me to make changes in this code, such that the password with '?' doesn't throw an error?

0 Answers
Related