Remove dead code

This commit is contained in:
Daniel Flanagan 2022-10-22 01:15:40 -05:00
parent ce53ef58da
commit cd30fe9634
Signed by untrusted user: lytedev-divvy
GPG key ID: 6D69CEEE4ABBCD82

View file

@ -158,30 +158,3 @@ func GetStarshipsPilots(starships []*Starship) map[*Starship][]*Person {
return result return result
} }
// Retrieves all the pilots for a given [Starship] simultaneously
func GetPilots(starship *Starship) []*Person {
var wg sync.WaitGroup
c := make(chan *Person)
for i := range starship.Pilots {
wg.Add(1)
go func(url string) {
person, _ := GetPerson(url)
if person != nil {
c <- person
}
}(starship.Pilots[i])
}
go func() {
wg.Wait()
close(c)
}()
var result []*Person
for r := range c {
result = append(result, r)
}
return result
}