// Terminate terminates the given instance specified with the id func (i Instances) Terminate(client *amazon.Client, db *mongodb.MongoDB, id string) { if id == "" { return } _, err := client.TerminateInstance(id) if err != nil { fmt.Printf("[%s] terminate error: %s\n", client.Region, err) } else { if err := deleteDocument(i[id], db); err != nil { fmt.Printf("[%s] deleting document for %q error: %s\n", client.Region, id, err) } } }