From 5ab429e996a797309eff938186216bf8b0034395 Mon Sep 17 00:00:00 2001 From: estlop Date: Fri, 1 Jul 2022 13:47:38 +0100 Subject: [PATCH] docs: Explain what to do when slice is empty or there are no even elements as per review docs: remove piscine imports and refactor to remove variable as per review --- subjects/evenlength/README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/subjects/evenlength/README.md b/subjects/evenlength/README.md index 08dcf15a..8b580c68 100644 --- a/subjects/evenlength/README.md +++ b/subjects/evenlength/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that receives a slice of strings and returns a new slice with the strings in which the length is even. +Write a function that receives a slice of strings and returns a new slice with the strings in which the length is even. When the slice is empty or there are no even strings return an empty slice. ### Expected function @@ -17,13 +17,11 @@ Here is a possible program to test your function: ```go package main -import ( - "piscine" - "fmt" -) + +import "fmt" + func main() { - l := piscine.EvenLength([]string{"Hi", "Hola", "Ola", "Ciao", "Salut", "Hallo"}) - fmt.Println(l) + fmt.Println(EvenLength([]string{"Hi", "Hola", "Ola", "Ciao", "Salut", "Hallo"})) } ```