Commit caa22088 authored by Aksel Baardsen's avatar Aksel Baardsen
Browse files

comments cleanup

parent afe1a985
......@@ -17,19 +17,4 @@ func TestGetString(t *testing.T) {
t.Errorf("[if nrk is up]Expected a body, got %s", s)
}
}
func TestContains(t *testing.T) {
var array = []int{1, 2, 3, 5, 28}
testCases := map[int]bool{
5: true,
4: false,
3: true,
29: false,
}
for i, b := range testCases {
if pkg.Contains(array, i) != b {
t.Errorf("Expected true, got false")
}
}
}
\ No newline at end of file
......@@ -62,16 +62,6 @@ func GetCountryByCode(code, limit string) (Country, int) {
check[species.Results[i]] = true
country.SpeciesKey = append(country.SpeciesKey, species.Results[i].SpeciesKey)
country.Species = append(country.Species, species.Results[i].Species)
/* and checks if the country-code is correct
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) {
country.Species = append(country.Species, species.Results[i].Species)
country.SpeciesKey = append(country.SpeciesKey, species.Results[i].SpeciesKey)
}
}
*/
}
return country, status
......
......@@ -25,21 +25,9 @@ func getString(url string) (string, int) {
return bodyString, resp.StatusCode
}
func contains(array []int, x int) bool {
for _, i := range array {
if i == x {
return true
}
}
return false
}
/*
funcs for testing purposes
*/
func Contains(array []int, x int) bool {
return contains(array, x)
}
func GetString(url string) (string, int) {
return getString(url)
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment