summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorJulien Dessaux2024-04-30 08:34:26 +0200
committerJulien Dessaux2024-04-30 08:34:26 +0200
commit72be13c3e986aaee110b8f9abc78f5afcef22727 (patch)
tree45f4b0ca60657cd2beccf639b9e7fe6db99ac0bd /pkg
parentchore(gonf): factorise hostflag management (diff)
downloadgonf-72be13c3e986aaee110b8f9abc78f5afcef22727.tar.gz
gonf-72be13c3e986aaee110b8f9abc78f5afcef22727.tar.bz2
gonf-72be13c3e986aaee110b8f9abc78f5afcef22727.zip
chore(gonf): fix go vet and staticcheck errors
Diffstat (limited to 'pkg')
-rw-r--r--pkg/custom.go2
-rw-r--r--pkg/packages.go2
-rw-r--r--pkg/permissions.go2
-rw-r--r--pkg/triggers.go11
-rw-r--r--pkg/values.go4
5 files changed, 4 insertions, 17 deletions
diff --git a/pkg/custom.go b/pkg/custom.go
index acca226..9b4ca3d 100644
--- a/pkg/custom.go
+++ b/pkg/custom.go
@@ -31,7 +31,7 @@ func (c *CustomPromise) Resolve() {
}
func (c CustomPromise) Status() Status {
- return c.Status()
+ return c.promise.Status()
}
func resolveCustomPromises() (status Status) {
diff --git a/pkg/packages.go b/pkg/packages.go
index fdce87c..bf9322c 100644
--- a/pkg/packages.go
+++ b/pkg/packages.go
@@ -7,7 +7,6 @@ var packages []*PackagePromise
// packages management functions
var packages_install_function func([]string) (Status, []string)
-var packages_update_function *CommandPromise
// ----- Init ------------------------------------------------------------------
func init() {
@@ -17,7 +16,6 @@ func init() {
// ----- Public ----------------------------------------------------------------
func SetPackagesConfiguration(install func([]string) (Status, []string), update *CommandPromise) {
packages_install_function = install
- packages_update_function = update
}
func Package(names ...string) *PackagePromise {
diff --git a/pkg/permissions.go b/pkg/permissions.go
index 3710e68..91287c0 100644
--- a/pkg/permissions.go
+++ b/pkg/permissions.go
@@ -75,7 +75,7 @@ func (p *Permissions) resolve(filename string) (Status, error) {
status = REPAIRED
}
} else {
- return BROKEN, errors.New("Unsupported operating system")
+ return BROKEN, errors.New("unsupported operating system")
}
}
return status, nil
diff --git a/pkg/triggers.go b/pkg/triggers.go
deleted file mode 100644
index 370ab1c..0000000
--- a/pkg/triggers.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package gonf
-
-type simpleTrigger struct {
- fact string
- status Status
-}
-
-//type compositeTrigger struct {
-// triggers []simpleTrigger
-// operation Operation
-//}
diff --git a/pkg/values.go b/pkg/values.go
index bb82787..25f31e4 100644
--- a/pkg/values.go
+++ b/pkg/values.go
@@ -68,13 +68,13 @@ type IntValue struct {
}
func (i IntValue) Bytes() []byte {
- return []byte(string(i.value))
+ return []byte(fmt.Sprint(i.value))
}
func (i IntValue) Int() (int, error) {
return i.value, nil
}
func (i IntValue) String() string {
- return string(i.value)
+ return fmt.Sprint(i.value)
}
// ----- StringsListValue ------------------------------------------------------