How does Go resolve seemingly same types?

Issue I have a PostgreSQL database with 2 columns: id (UUID), company_url (varchar) with following values: 2fc35af4-5f5c-445e-86c5-01d93513b8be | https://test.com 2bf31b75-d1f3-4a9c-a530-73b714816e9e | https://test2.com Here’s the code to access the table using Go (error handling and credentials omited for simplicity): package main

Continue reading

Postgres + Go + Docker-compose Can't ping database: dial tcp 127.0.0.1:5432: connect: connection refused

Issue It is not my golang script, but i should to use them in this task: package main import ( "database/sql" "fmt" _ "github.com/lib/pq" "log" "net/http" "github.com/caarlos0/env" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) type config struct { PostgresUri string `env:"POSTGRES_URI" envDefault:"postgres://root:pass@127.0.0.1/postgres"` ListenAddress string

Continue reading