diff options
author | Julien Dessaux | 2024-05-01 16:23:08 +0200 |
---|---|---|
committer | Julien Dessaux | 2024-05-01 16:23:08 +0200 |
commit | 8b9195e3e3506d576b39a23ca646c260dfacc808 (patch) | |
tree | 1cdbdd2fb368654ef8eab702258eb5d6a90e1447 /pkg/packages.go | |
parent | chore(gonf): fix go vet and staticcheck errors (diff) | |
download | gonf-8b9195e3e3506d576b39a23ca646c260dfacc808.tar.gz gonf-8b9195e3e3506d576b39a23ca646c260dfacc808.tar.bz2 gonf-8b9195e3e3506d576b39a23ca646c260dfacc808.zip |
chore(gonf): fix errcheck and shadow errors
Diffstat (limited to 'pkg/packages.go')
-rw-r--r-- | pkg/packages.go | 11 |
1 files changed, 3 insertions, 8 deletions
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 { |