diff --git a/def/task.go b/def/task.go index 1b4af97..973021f 100644 --- a/def/task.go +++ b/def/task.go @@ -43,7 +43,7 @@ func TasksFromJSON(uri string) ([]Task, error) { func (tsk *Task) UpdateHost(newHost string) bool { // Validation isCorrectHost := false - for _, existingHost := range constants.Hosts { + for existingHost, _ := range constants.Hosts { if newHost == existingHost { isCorrectHost = true } diff --git a/pcp/logAndProgressiveExtrema.go b/pcp/logAndProgressiveExtrema.go index f708bef..4a2cf56 100644 --- a/pcp/logAndProgressiveExtrema.go +++ b/pcp/logAndProgressiveExtrema.go @@ -3,6 +3,7 @@ package pcp import ( "bitbucket.org/sunybingcloud/electron/constants" "bitbucket.org/sunybingcloud/electron/rapl" + "bitbucket.org/sunybingcloud/electron/utilities" "bufio" "container/ring" "log" @@ -14,7 +15,6 @@ import ( "strings" "syscall" "time" - "bitbucket.org/sunybingcloud/electron/utilities" ) func round(num float64) int { @@ -202,7 +202,7 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, pref // If cannot find any victim, then all nodes have been capped to the maximum and we stop capping at this point. } } - if (!canCapAlreadyCappedVictim) { + if !canCapAlreadyCappedVictim { log.Println("No Victim left to cap.") } }