From 69927c76ffd85f08ab2f8838bf5f483e468a4c9c Mon Sep 17 00:00:00 2001 From: mStar Date: Sat, 29 Mar 2025 17:51:56 +0100 Subject: [PATCH] More fixes, this time for cmd stuff --- cmd/migrate-new/main.go | 2 +- cmd/model-gen/main.go | 10 ++++++++++ go.mod | 33 +++++++++++++++------------------ 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/cmd/migrate-new/main.go b/cmd/migrate-new/main.go index 268ac27..23a9759 100644 --- a/cmd/migrate-new/main.go +++ b/cmd/migrate-new/main.go @@ -10,7 +10,7 @@ import ( "git.mstar.dev/mstar/linstrom/config" "git.mstar.dev/mstar/linstrom/shared" - "git.mstar.dev/mstar/linstrom/storage-new" + storage "git.mstar.dev/mstar/linstrom/storage-new" ) func main() { diff --git a/cmd/model-gen/main.go b/cmd/model-gen/main.go index 0c0ac07..5ae4433 100644 --- a/cmd/model-gen/main.go +++ b/cmd/model-gen/main.go @@ -18,6 +18,14 @@ import ( "git.mstar.dev/mstar/linstrom/storage-new/models" ) +// "git.mstar.dev/mstar/linstrom/config" + +// "context" +// "time" +// postgresContainer "github.com/testcontainers/testcontainers-go/modules/postgres" +// "github.com/testcontainers/testcontainers-go" +// "github.com/testcontainers/testcontainers-go/wait" + const ( dbName = "linstrom" dbUser = "linstrom" @@ -28,6 +36,7 @@ func main() { other.SetupFlags() flag.Parse() other.ConfigureLogging(nil) + // config.ReadAndWriteToGlobal(*shared.FlagConfigFile) // Set up a temporary postgres container for gorm-gen to do its thing log.Info().Msg("Starting temporary postgres container") @@ -55,6 +64,7 @@ func main() { log.Info().Msg("Temporary postgres container stopped") }() db, err := gorm.Open( + // postgres.Open(config.GlobalConfig.Storage.BuildPostgresDSN()), postgres.Open(pgContainer.MustConnectionString(context.Background())), &gorm.Config{ PrepareStmt: false, diff --git a/go.mod b/go.mod index cc7b17a..1dfce74 100644 --- a/go.mod +++ b/go.mod @@ -33,36 +33,21 @@ require ( gorm.io/plugin/dbresolver v1.5.3 ) -require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect - golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect - golang.org/x/sync v0.12.0 // indirect - google.golang.org/protobuf v1.33.0 // indirect -) - require ( dario.cat/mergo v1.0.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/containerd/containerd v1.7.18 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v0.2.1 // indirect github.com/cpuguy83/dockercfg v0.3.2 // indirect github.com/datainq/xml-date-time v0.0.0-20170820214645-2292f08baa38 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/docker v27.1.1+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect @@ -81,6 +66,8 @@ require ( github.com/goccy/go-json v0.10.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-tpm v0.9.1 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect @@ -94,6 +81,7 @@ require ( github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/minio/md5-simd v1.1.2 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect @@ -105,8 +93,14 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect github.com/piprate/json-gold v0.5.0 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect + github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect + github.com/prometheus/client_golang v1.14.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/xid v1.6.0 // indirect github.com/shirou/gopsutil/v3 v3.23.12 // indirect @@ -125,11 +119,14 @@ require ( go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect + golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.30.0 // indirect + golang.org/x/sync v0.12.0 // indirect golang.org/x/sys v0.31.0 // indirect golang.org/x/text v0.23.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gorm.io/datatypes v1.2.5 // indirect gorm.io/driver/mysql v1.5.7 // indirect