From e3251487b7a295d23c56c28424d6137a76a371f0 Mon Sep 17 00:00:00 2001 From: nprimo Date: Wed, 22 May 2024 10:49:36 +0100 Subject: [PATCH] docs(lastword): update provided example to be clearer --- subjects/lastword/README.md | 11 +++++------ subjects/lastword/main.go | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/subjects/lastword/README.md b/subjects/lastword/README.md index ee33dc8db..6af555c84 100644 --- a/subjects/lastword/README.md +++ b/subjects/lastword/README.md @@ -22,15 +22,14 @@ Here is a possible program to test your function : package main import ( + "fmt" "piscine" - - "github.com/01-edu/z01" ) func main() { - z01.PrintRune(piscine.LastWord("this ... is sparta, then again, maybe not")) - z01.PrintRune(piscine.LastWord(" ")) - z01.PrintRune(piscine.LastWord(" lorem,ipsum ")) + fmt.Print(piscine.LastWord("this ... is sparta, then again, maybe not")) + fmt.Print(piscine.LastWord(" lorem,ipsum ")) + fmt.Print(piscine.LastWord(" ")) } ``` @@ -39,9 +38,9 @@ And its output : ```console $ go run . | cat -e not$ -$ lorem,ipsum$ $ +$ ``` ### Notions diff --git a/subjects/lastword/main.go b/subjects/lastword/main.go index 9c5e8467c..a6883832e 100644 --- a/subjects/lastword/main.go +++ b/subjects/lastword/main.go @@ -1,13 +1,12 @@ package main import ( + "fmt" "piscine" - - "github.com/01-edu/z01" ) func main() { - z01.PrintRune(piscine.LastWord("this ... is sparta, then again, maybe not")) - z01.PrintRune(piscine.LastWord(" ")) - z01.PrintRune(piscine.LastWord(" lorem,ipsum ")) + fmt.Print(piscine.LastWord("this ... is sparta, then again, maybe not")) + fmt.Print(piscine.LastWord(" lorem,ipsum ")) + fmt.Print(piscine.LastWord(" ")) }