mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
improve boolean logic
This commit is contained in:
parent
6bee1b7f31
commit
4d48245d7d
@ -61,7 +61,7 @@ func UpdateSwitch(k string, val bool) {
|
||||
// Toggle a boolean switch
|
||||
func Toggle(k string) {
|
||||
sw := GetSwitch(k)
|
||||
newVal := sw.Val != true
|
||||
newVal := !sw.Val
|
||||
log.Noticef("config change: %s: %t -> %t", k, sw.Val, newVal)
|
||||
sw.Val = newVal
|
||||
//log.Errorf("ignoring toggle for non-existant switch: %s", k)
|
||||
|
@ -113,7 +113,7 @@ func (cm *Docker) refresh(c *container.Container) {
|
||||
func (cm *Docker) inspect(id string) *api.Container {
|
||||
c, err := cm.client.InspectContainer(id)
|
||||
if err != nil {
|
||||
if _, ok := err.(*api.NoSuchContainer); ok == false {
|
||||
if _, ok := err.(*api.NoSuchContainer); !ok {
|
||||
log.Errorf(err.Error())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user