From 042298332eafe9c33ca34d0e3c1b4b56728bb3a8 Mon Sep 17 00:00:00 2001 From: estlop Date: Fri, 1 Jul 2022 14:00:22 +0100 Subject: [PATCH] docs: Explain what to do when slice is empty or there are no odd elements as per review docs: Remove piscine imports and refactor as per review --- subjects/oddlength/README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/subjects/oddlength/README.md b/subjects/oddlength/README.md index f7cfa36b..a5a604cf 100644 --- a/subjects/oddlength/README.md +++ b/subjects/oddlength/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 odd. +Write a function that receives a slice of strings and returns a new slice with the strings in which the length is odd. When the slice is empty or there are no odd strings return an empty slice. ### Expected function @@ -19,14 +19,10 @@ Here is a possible program to test your function: ```go package main -import ( - "piscine" - "fmt" -) +import "fmt" func main() { - l := piscine.Oddlength(["Hi", "Hola", "Ola", "Ciao", "Salut", "Hallo"]) - fmt.Println(l) + fmt.Println(Oddlength(["Hi", "Hola", "Ola", "Ciao", "Salut", "Hallo"])) } ```