I have two different codes to connect postgresql with golang first code like this
connStr := fmt.Sprintf("user=%s password=%s dbname=%s sslmode=disable", user, password, dbName)
and the second one like this
connStr := fmt.Sprintf("postgres://%s:%s@localhost/%s?sslmode=disable", user, password, dbName)
What's the difference between them? And when do I have to use the second one?