From 0fe21658449d0636936c403c11ed5e74a59484ee Mon Sep 17 00:00:00 2001 From: jotapero Date: Mon, 17 Oct 2022 17:19:52 +0100 Subject: [PATCH] docs(sliceRemove): fix subject - fixed incorrect output - fix grammar - fix identation --- subjects/sliceremove/README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/subjects/sliceremove/README.md b/subjects/sliceremove/README.md index cf88c577..88202d53 100644 --- a/subjects/sliceremove/README.md +++ b/subjects/sliceremove/README.md @@ -2,8 +2,8 @@ ### Instructions -- Write a function that takes a slice of integers and int and removes any number in the slice that is equal to the int then returns the slice -- If the slice is empty, return the slice itself +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 @@ -15,25 +15,27 @@ func SliceRemove(slice []int , num int) []int { ### Usage -Here is a possible program to test your function : +Here is a possible program to test your function: ```go package main import ( "fmt" + + "piscine" ) func main() { - fmt.Println(SliceRemove([]int{1, 2, 3},2)) - fmt.Println(SliceRemove([]int{4,3}, 4)) + fmt.Println(piscine.SliceRemove([]int{1, 2, 3}, 2)) + fmt.Println(piscine.SliceRemove([]int{4, 3}, 4)) } ``` -And its output : +And its output: ```console $ go run . -[1 3 4] -[4] +[1 3] +[3] ```