From a58f6c6a0d38e34ef4c531e0d31e23510dfa0f7d Mon Sep 17 00:00:00 2001 From: soypete Date: Mon, 22 Jan 2024 13:07:52 -0700 Subject: [PATCH] exercise-2: read mody text Signed-off-by: soypete --- exercise-2/main.go | 4 ++-- exercise-2/solution/main.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exercise-2/main.go b/exercise-2/main.go index 77acb65..7d1ff14 100644 --- a/exercise-2/main.go +++ b/exercise-2/main.go @@ -30,8 +30,8 @@ func (wp *workerPool) run() int { // getMessages gets a slice of messages to process func getMessages() []string { - // file, _ := os.ReadFile("datums/melville-moby_dick.txt") - words := strings.Split("We dont want to overload io threads and the runtime while we are benchmarking, so we are addings some others words that are not as much but talk about go and other cool software things", " ") + file, _ := os.ReadFile("datums/melville-moby_dick.txt") + words := strings.Split(string(file), " ") return words } diff --git a/exercise-2/solution/main.go b/exercise-2/solution/main.go index fae3be8..096dc48 100644 --- a/exercise-2/solution/main.go +++ b/exercise-2/solution/main.go @@ -44,8 +44,8 @@ func (wp *workerPool) run() int { // getMessages gets a slice of messages to process func getMessages() []string { - // file, _ := os.ReadFile("datums/melville-moby_dick.txt") - words := strings.Split("We dont want to overload io threads and the runtime while we are benchmarking, so we are addings some others words that are not as much but talk about go and other cool software things", " ") + file, _ := os.ReadFile("datums/melville-moby_dick.txt") + words := strings.Split(string(file), " ") return words }