From cd30fe9634a8d566cd7b5aa69d02fc738a49b37a Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 22 Oct 2022 01:15:40 -0500 Subject: [PATCH] Remove dead code --- swapi.go | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/swapi.go b/swapi.go index b9e0ae1..1fcda64 100644 --- a/swapi.go +++ b/swapi.go @@ -158,30 +158,3 @@ func GetStarshipsPilots(starships []*Starship) map[*Starship][]*Person { 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 -}