File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ module github.com/jgustavoj/go_stuff
2
2
3
3
go 1.20
4
4
5
- require github.com/jgustavoj/go_greetings v0.0.0-20230606010836-5ea966f88545
5
+ require github.com/jgustavoj/go_greetings v0.0.0-20230608002123-7fc5d12697de
Original file line number Diff line number Diff line change 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 =
Original file line number Diff line number Diff line change @@ -23,8 +23,12 @@ func main() {
23
23
log .SetPrefix ("greetings: " )
24
24
log .SetFlags (0 )
25
25
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
+
28
32
// If an error was returned, print it to the console and
29
33
// exit the program.
30
34
if err != nil {
@@ -33,5 +37,5 @@ func main() {
33
37
34
38
// If no error was returned, print the returned message
35
39
// to the console.
36
- fmt .Println (message )
40
+ fmt .Println (messages )
37
41
}
You can’t perform that action at this time.
0 commit comments