From a018c69f90e0cf763e258d6e3499b3274b4e1ad9 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 18 Jul 2022 13:28:25 +0200 Subject: [PATCH] gen-manifests: simplify flag definitions Remove the reliance on flag variable pointers and read the argument values directly into the target variables. --- cmd/gen-manifests/main.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cmd/gen-manifests/main.go b/cmd/gen-manifests/main.go index a3c479a29..741f2cd64 100644 --- a/cmd/gen-manifests/main.go +++ b/cmd/gen-manifests/main.go @@ -323,15 +323,13 @@ func mergeOverrides(base, overrides composeRequest) composeRequest { } func main() { - outputDirFlag := flag.String("output", "test/data/manifests.plain/", "manifest store directory") - nWorkersFlag := flag.Int("workers", 16, "number of workers to run concurrently") - cacheRootFlag := flag.String("cache", "/tmp/rpmmd", "rpm metadata cache directory") + var outputDir, cacheRoot string + var nWorkers int + flag.StringVar(&outputDir, "output", "test/data/manifests.plain/", "manifest store directory") + flag.IntVar(&nWorkers, "workers", 16, "number of workers to run concurrently") + flag.StringVar(&cacheRoot, "cache", "/tmp/rpmmd", "rpm metadata cache directory") flag.Parse() - outputDir := *outputDirFlag - nWorkers := *nWorkersFlag - cacheRoot := *cacheRootFlag - seedArg := int64(0) darm := readRepos() distros := distroregistry.NewDefault()