func scan(ship *dtl.Ship) ([]*dtl.Ship, []*dtl.Sector, error) { for { if ship.CanScan() { return ship.ScanSector() } time.Sleep(1 * time.Second) } }