diff --git a/subjects/sliceremove/README.md b/subjects/sliceremove/README.md index 88202d53..c6ff7d60 100644 --- a/subjects/sliceremove/README.md +++ b/subjects/sliceremove/README.md @@ -3,6 +3,7 @@ ### Instructions Write a function that takes a slice of integers and an `int` as arguments, if the given `int` exists in the slice then remove it, otherwise return the slice. + - If the slice is empty, return the slice itself. ### Expected function @@ -29,6 +30,8 @@ import ( func main() { fmt.Println(piscine.SliceRemove([]int{1, 2, 3}, 2)) fmt.Println(piscine.SliceRemove([]int{4, 3}, 4)) + fmt.Println(piscine.SliceRemove([]int{}, 1)) + } ``` @@ -38,4 +41,5 @@ And its output: $ go run . [1 3] [3] +[] ```