chore(gonf): fix go vet and staticcheck errors
This commit is contained in:
parent
cae4735276
commit
72be13c3e9
6 changed files with 4 additions and 18 deletions
|
@ -31,7 +31,7 @@ func (c *CustomPromise) Resolve() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c CustomPromise) Status() Status {
|
func (c CustomPromise) Status() Status {
|
||||||
return c.Status()
|
return c.promise.Status()
|
||||||
}
|
}
|
||||||
|
|
||||||
func resolveCustomPromises() (status Status) {
|
func resolveCustomPromises() (status Status) {
|
||||||
|
|
|
@ -7,7 +7,6 @@ var packages []*PackagePromise
|
||||||
|
|
||||||
// packages management functions
|
// packages management functions
|
||||||
var packages_install_function func([]string) (Status, []string)
|
var packages_install_function func([]string) (Status, []string)
|
||||||
var packages_update_function *CommandPromise
|
|
||||||
|
|
||||||
// ----- Init ------------------------------------------------------------------
|
// ----- Init ------------------------------------------------------------------
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -17,7 +16,6 @@ func init() {
|
||||||
// ----- Public ----------------------------------------------------------------
|
// ----- Public ----------------------------------------------------------------
|
||||||
func SetPackagesConfiguration(install func([]string) (Status, []string), update *CommandPromise) {
|
func SetPackagesConfiguration(install func([]string) (Status, []string), update *CommandPromise) {
|
||||||
packages_install_function = install
|
packages_install_function = install
|
||||||
packages_update_function = update
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Package(names ...string) *PackagePromise {
|
func Package(names ...string) *PackagePromise {
|
||||||
|
|
|
@ -75,7 +75,7 @@ func (p *Permissions) resolve(filename string) (Status, error) {
|
||||||
status = REPAIRED
|
status = REPAIRED
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return BROKEN, errors.New("Unsupported operating system")
|
return BROKEN, errors.New("unsupported operating system")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return status, nil
|
return status, nil
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
package gonf
|
|
||||||
|
|
||||||
type simpleTrigger struct {
|
|
||||||
fact string
|
|
||||||
status Status
|
|
||||||
}
|
|
||||||
|
|
||||||
//type compositeTrigger struct {
|
|
||||||
// triggers []simpleTrigger
|
|
||||||
// operation Operation
|
|
||||||
//}
|
|
|
@ -68,13 +68,13 @@ type IntValue struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i IntValue) Bytes() []byte {
|
func (i IntValue) Bytes() []byte {
|
||||||
return []byte(string(i.value))
|
return []byte(fmt.Sprint(i.value))
|
||||||
}
|
}
|
||||||
func (i IntValue) Int() (int, error) {
|
func (i IntValue) Int() (int, error) {
|
||||||
return i.value, nil
|
return i.value, nil
|
||||||
}
|
}
|
||||||
func (i IntValue) String() string {
|
func (i IntValue) String() string {
|
||||||
return string(i.value)
|
return fmt.Sprint(i.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- StringsListValue ------------------------------------------------------
|
// ----- StringsListValue ------------------------------------------------------
|
||||||
|
|
|
@ -66,5 +66,4 @@ func systemd_service(name, state string) (gonf.Status, error) {
|
||||||
default:
|
default:
|
||||||
return gonf.BROKEN, errors.New("unsupported systemctl operation " + state)
|
return gonf.BROKEN, errors.New("unsupported systemctl operation " + state)
|
||||||
}
|
}
|
||||||
return gonf.KEPT, nil
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue