From 8b9195e3e3506d576b39a23ca646c260dfacc808 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 1 May 2024 16:23:08 +0200 Subject: chore(gonf): fix errcheck and shadow errors --- pkg/packages.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'pkg/packages.go') diff --git a/pkg/packages.go b/pkg/packages.go index bf9322c..87db647 100644 --- a/pkg/packages.go +++ b/pkg/packages.go @@ -2,20 +2,16 @@ package gonf import "log/slog" -// ----- Globals --------------------------------------------------------------- var packages []*PackagePromise -// packages management functions -var packages_install_function func([]string) (Status, []string) +var packagesInstallFunction func([]string) (Status, []string) -// ----- Init ------------------------------------------------------------------ func init() { packages = make([]*PackagePromise, 0) } -// ----- Public ---------------------------------------------------------------- func SetPackagesConfiguration(install func([]string) (Status, []string), update *CommandPromise) { - packages_install_function = install + packagesInstallFunction = install } func Package(names ...string) *PackagePromise { @@ -45,7 +41,7 @@ func (p *PackagePromise) Promise() Promise { } func (p *PackagePromise) Resolve() { - status, affected := packages_install_function(p.names) + status, affected := packagesInstallFunction(p.names) switch status { case BROKEN: slog.Error("package", "names", p.names, "status", status, "broke", affected) @@ -63,7 +59,6 @@ func (p PackagePromise) Status() Status { return p.status } -// ----- Internal -------------------------------------------------------------- func resolvePackages() (status Status) { status = KEPT for _, c := range packages { -- cgit v1.2.3