title: Save error in database Golang
body: <p>I'm running http request in golang </p>
  
  <pre><code>resp, err := client.Do(req)
      if err != nil {
          return "", err
      }
  </code></pre>
  
  <p>So, it returns error back to the main function, that attempts to store it in the database:</p>
  
  <pre><code>_, err = db.Exec("UPDATE test SET error = $1 WHERE id = $2", error, id)
  </code></pre>
  
  <p>I receive the following error: <code>sql: converting Exec argument #1's type: unsupported type errors.errorString, a struct exit status 1</code></p>
  
  <p>So, I understand, that error has a different type, but I can't find information on how to pass the value of the error to the string. Could someone direct me in a right way.</p>