Last active
June 5, 2020 04:08
-
-
Save kjk/e4e690a79190b67879fe73dbca03eabe to your computer and use it in GitHub Desktop.
example for https://notion.so/d7afa1154b434d1d802669cd92c1f6cf (made with https://codeeval.dev)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
// :show start | |
func filterEvenValues(a []int) []int { | |
var res []int | |
for _, el := range a { | |
if el%2 == 0 { | |
continue | |
} | |
res = append(res, el) | |
} | |
return res | |
} | |
// :show end | |
func main() { | |
// :show start | |
a := []int{1, 2, 3, 4} | |
res := filterEvenValues(a) | |
fmt.Printf("%#v\n", res) | |
// :show end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment