Skip to content

Commit

Permalink
Use accessor functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-jones committed Dec 6, 2024
1 parent 3aed1a5 commit b62fb99
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ func run(ctx context.Context, cfg config, message string) error {
return err
}

fmt.Printf("response from server: %s\n", res.Message)
fmt.Printf("response from server: %s\n", res.GetMessage())

fmt.Println("metadata from server:")
for _, item := range res.Metadata.Items {
fmt.Printf("%s: %s\n", item.Key, strings.Join(item.Values, ", "))
if metadata := res.GetMetadata(); metadata != nil {
fmt.Println("metadata from server:")
for _, item := range metadata.GetItems() {
fmt.Printf("%s: %s\n", item.Key, strings.Join(item.Values, ", "))
}
}

return nil
Expand Down

0 comments on commit b62fb99

Please sign in to comment.