From a28ac1ea5070133c432357adc81559e9e9be1f77 Mon Sep 17 00:00:00 2001 From: jrosendo Date: Mon, 7 Nov 2022 17:28:04 +0000 Subject: [PATCH] docs(sliceRemove): fixed subject - added one more output example - fixed missing space --- subjects/sliceremove/README.md | 4 ++++ 1 file changed, 4 insertions(+) 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] +[] ```