2020/05/11 14:58:19 http: panic serving [::1]:51401: runtime error: invalid memory address or nil pointer dereference goroutine 19 [running]:

Your dbvar is nil when used in the different functions because in this line you’re actually declaring a local variable with the same name that shadows the global one:

db, err := sql.Open("postgres", psqlInfo)
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.