Formatted the code
This commit is contained in:
parent
b7394b8762
commit
cd644bbf69
1 changed files with 5 additions and 5 deletions
10
def/task.go
10
def/task.go
|
@ -17,7 +17,7 @@ type Task struct {
|
||||||
CMD string `json:"cmd"`
|
CMD string `json:"cmd"`
|
||||||
Instances *int `json:"inst"`
|
Instances *int `json:"inst"`
|
||||||
Host string `json:"host"`
|
Host string `json:"host"`
|
||||||
TaskID string `json:"taskID"`
|
TaskID string `json:"taskID"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func TasksFromJSON(uri string) ([]Task, error) {
|
func TasksFromJSON(uri string) ([]Task, error) {
|
||||||
|
@ -42,10 +42,10 @@ func (tsk *Task) UpdateHost(new_host string) bool {
|
||||||
// Validation
|
// Validation
|
||||||
is_correct_host := false
|
is_correct_host := false
|
||||||
for _, existing_host := range constants.Hosts {
|
for _, existing_host := range constants.Hosts {
|
||||||
if new_host == existing_host {
|
if new_host == existing_host {
|
||||||
is_correct_host = true
|
is_correct_host = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !is_correct_host {
|
if !is_correct_host {
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
|
|
Reference in a new issue