| skipped 300 lines |
301 | 301 | | // Function constructor - constructs new function for listing given directory |
302 | 302 | | func listAgents(c2 string) func(string) []string { |
303 | 303 | | return func(line string) []string { |
304 | | - | if agent == "Not Connected" { |
305 | | - | var a = []string{""} |
306 | | - | return a |
307 | | - | } |
308 | 304 | | resp, err := http.Get(c2 + "/api/agents") |
309 | 305 | | if resp.Status == "200 OK" { |
310 | 306 | | if err != nil { |
| skipped 20 lines |
331 | 327 | | } |
332 | 328 | | return names |
333 | 329 | | } |
334 | | - | return nil |
| 330 | + | var a = []string{""} |
| 331 | + | return a |
| 332 | + | |
335 | 333 | | } |
336 | 334 | | } |
337 | 335 | | |
| skipped 203 lines |