I am sure that there is something with the connectionString as the values I am giving are the same values that I use in Java to log into the same database. This is my code
package main
import(
"fmt"
"database/sql"
_ "github.com/lib/pq"
"log"
)
func main() {
db, err := sql.Open("postgres", "user=postgres password=password dbname=name sslmode=disable")
if err != nil {
log.Fatal(err)
}
defer db.Close()
age := 21
rows, err := db.Query("SELECT city FROM streams WHERE id=69", age)
fmt.Println(rows)
}
I am using what I found here https://godoc.org/github.com/lib/pq my postgres version is 9.4 and my Go Version is 1.6 . I have no idea why it is happening.