Skip to content

Commit 45ef82b

Browse files
committed
updated module and main func with slice of names and passes Hellos new func
1 parent 15169ae commit 45ef82b

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/jgustavoj/go_stuff
22

33
go 1.20
44

5-
require github.com/jgustavoj/go_greetings v0.0.0-20230606010836-5ea966f88545
5+
require github.com/jgustavoj/go_greetings v0.0.0-20230608002123-7fc5d12697de

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
github.com/jgustavoj/go_greetings v0.0.0-20230602150140-67105fa54f22 h1:+p3VyEKyCnCGl9LHNqgTgRXYwZUshIEo3deDts5LIow=
2-
github.com/jgustavoj/go_greetings v0.0.0-20230602150140-67105fa54f22/go.mod h1:pnJuwrZr5jih387/ikkRBJ4cY7sQVxee1VbB5fW13yU=
3-
github.com/jgustavoj/go_greetings v0.0.0-20230606010836-5ea966f88545 h1:Dex43mRvWBzLs18PFrviSZTba96RRbCcFW7QCKFi210=
4-
github.com/jgustavoj/go_greetings v0.0.0-20230606010836-5ea966f88545/go.mod h1:pnJuwrZr5jih387/ikkRBJ4cY7sQVxee1VbB5fW13yU=
1+
github.com/jgustavoj/go_greetings v0.0.0-20230608002123-7fc5d12697de h1:PkpzuEn/k3b7lIw8Cyc9CIHF5k5YEG/zVwY37DWWmU8=
2+
github.com/jgustavoj/go_greetings v0.0.0-20230608002123-7fc5d12697de/go.mod h1:pnJuwrZr5jih387/ikkRBJ4cY7sQVxee1VbB5fW13yU=

hello.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ func main() {
2323
log.SetPrefix("greetings: ")
2424
log.SetFlags(0)
2525

26-
// Request a greeting message.
27-
message, err := greetings.Hello("Gladys")
26+
// A slice of names.
27+
names := []string{"Gladys", "Samantha", "Darrin"}
28+
29+
// Request greeting messages for the names.
30+
messages, err := greetings.Hellos(names)
31+
2832
// If an error was returned, print it to the console and
2933
// exit the program.
3034
if err != nil {
@@ -33,5 +37,5 @@ func main() {
3337

3438
// If no error was returned, print the returned message
3539
// to the console.
36-
fmt.Println(message)
40+
fmt.Println(messages)
3741
}

0 commit comments

Comments
 (0)