Skip to content
Snippets Groups Projects
Commit e0a96817 authored by Aksel Baardsen's avatar Aksel Baardsen
Browse files

added explanatory comments

parent c13fefdc
No related branches found
No related tags found
No related merge requests found
...@@ -52,10 +52,11 @@ func GetCountryByCode(code, limit string) Country { ...@@ -52,10 +52,11 @@ func GetCountryByCode(code, limit string) Country {
log.Fatal(err) log.Fatal(err)
} }
// adds specieskeys&specienames to the country struct // adds species-keys & specie-names to the country struct
// and checks if the countrycode is correct for i, _ := range species.Results {
for i, _ := range species.Results {//i := 0; i < len(species.Results); i++ { // and checks if the country-code is correct
if country.Code == species.Results[i].CountryCode { if country.Code == species.Results[i].CountryCode {
// and checks that the species is unique
if species.Results[i].SpeciesKey != 0 || contains(country.SpeciesKey, species.Results[i].SpeciesKey) { if species.Results[i].SpeciesKey != 0 || contains(country.SpeciesKey, species.Results[i].SpeciesKey) {
country.Species = append(country.Species, species.Results[i].Species) country.Species = append(country.Species, species.Results[i].Species)
country.SpeciesKey = append(country.SpeciesKey, species.Results[i].SpeciesKey) country.SpeciesKey = append(country.SpeciesKey, species.Results[i].SpeciesKey)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment