Mirror for https://github.com/STBoyden/go-portfolio
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

build: update gotenv version

stboyden.com f6d9a844 0e54a913

verified
+10 -8
+5 -6
cmd/migrations/main.go
··· 1 1 package main 2 2 3 3 import ( 4 - "database/sql" 5 4 "fmt" 6 5 "strings" 7 6 ··· 9 8 "github.com/STBoyden/go-portfolio/internal/pkg/common/utils" 10 9 "github.com/STBoyden/gotenv/v2" 11 10 "github.com/golang-migrate/migrate/v4" 12 - "github.com/golang-migrate/migrate/v4/database/pgx/v5" 11 + migratePgx "github.com/golang-migrate/migrate/v4/database/pgx/v5" 13 12 _ "github.com/golang-migrate/migrate/v4/source/file" 14 13 _ "github.com/lib/pq" 15 14 ) 16 15 17 16 func main() { 18 - env, _ := gotenv.LoadEnvFromFS(fs.EnvFile) 17 + env, _ := gotenv.LoadEnvFromFS(fs.EnvFile, gotenv.LoadOptions{OverrideExistingVars: false}) 19 18 20 19 var dbUrl string 21 20 if s, ok := env["DB_URL"]; !ok { ··· 24 23 dbUrl = strings.Trim(s, "\"") 25 24 } 26 25 27 - db := utils.Must(sql.Open("postgres", dbUrl)) 28 - driver := utils.Must(pgx.WithInstance(db, &pgx.Config{})) 29 - migrations := utils.Must(migrate.NewWithDatabaseInstance("file://./migrations/", "postgres", driver)) 26 + p := &migratePgx.Postgres{} 27 + driver := utils.Must(p.Open(dbUrl)) 28 + migrations := utils.Must(migrate.NewWithDatabaseInstance("file://./migrations/", "pgx", driver)) 30 29 31 30 err := migrations.Up() 32 31 if err != nil && !strings.Contains(err.Error(), "no change") {
+1 -1
go.mod
··· 3 3 go 1.24.0 4 4 5 5 require ( 6 - github.com/STBoyden/gotenv/v2 v2.0.2 6 + github.com/STBoyden/gotenv/v2 v2.0.3 7 7 github.com/a-h/templ v0.3.833 8 8 github.com/golang-migrate/migrate/v4 v4.18.2 9 9 github.com/google/uuid v1.6.0
+2
go.sum
··· 15 15 github.com/PuerkitoBio/goquery v1.10.2/go.mod h1:0guWGjcLu9AYC7C1GHnpysHy056u9aEkUHwhdnePMCU= 16 16 github.com/STBoyden/gotenv/v2 v2.0.2 h1:iC4oraR+8OA5c7auA+8oPlFG218wT7+n46UvVAViKs0= 17 17 github.com/STBoyden/gotenv/v2 v2.0.2/go.mod h1:VArJ6jz6Km2SyTIZxqh+594vhBptAOzdn9AbpoBmrf0= 18 + github.com/STBoyden/gotenv/v2 v2.0.3 h1:aZzdfhiYWysHJpaHX7B0wTMPfb+ciUCStlz3TKfUp1A= 19 + github.com/STBoyden/gotenv/v2 v2.0.3/go.mod h1:VArJ6jz6Km2SyTIZxqh+594vhBptAOzdn9AbpoBmrf0= 18 20 github.com/a-h/parse v0.0.0-20250122154542-74294addb73e h1:HjVbSQHy+dnlS6C3XajZ69NYAb5jbGNfHanvm1+iYlo= 19 21 github.com/a-h/parse v0.0.0-20250122154542-74294addb73e/go.mod h1:3mnrkvGpurZ4ZrTDbYU84xhwXW2TjTKShSwjRi2ihfQ= 20 22 github.com/a-h/templ v0.3.833 h1:L/KOk/0VvVTBegtE0fp2RJQiBm7/52Zxv5fqlEHiQUU=
+2 -1
justfile
··· 27 27 run: build 28 28 ./build/portfolio 29 29 30 - [confirm("Please make sure that DB_URL is set to a production database URL AND that the secret is pushed to fly.\nPress ENTER to continue, use Ctrl+C to cancel > ")] 30 + [confirm("Please make sure that DB_URL is set to a production database URL.\nPress ENTER to continue, use Ctrl+C to cancel > ")] 31 31 deploy: generate_db_types 32 + source .env 32 33 fly deploy