missing "="

I get this error if i try to connect to railway db with go, missing "=" after "\"postgresql://<user>:<pw>@<host>:<port>/railway\"" in connection info string" I connect like this:
import (
"database/sql"
"fmt"

_ "github.com/lib/pq"
)

func main() {
db, err := sql.Open("postgres", config.DB_URL)

if err != nil {
fmt.Println(err)
return
}
defer db.Close()

err = db.Ping()
if err != nil {
fmt.Println(err)
return
}
}
import (
"database/sql"
"fmt"

_ "github.com/lib/pq"
)

func main() {
db, err := sql.Open("postgres", config.DB_URL)

if err != nil {
fmt.Println(err)
return
}
defer db.Close()

err = db.Ping()
if err != nil {
fmt.Println(err)
return
}
}
3 Replies
Want results from more Discord servers?
Add your server