From 0a45f324c7aeb431fbf2a1417a0d100d12c156ba Mon Sep 17 00:00:00 2001 From: Zachary Romero Date: Wed, 25 Jul 2018 19:31:52 +0300 Subject: [PATCH] wire: fix example in the ProvideBaz section (google/go-cloud#229) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 93cffaa..340864f 100644 --- a/README.md +++ b/README.md @@ -77,8 +77,8 @@ type Baz struct { // ProvideBaz returns a value if Bar is not zero. func ProvideBaz(ctx context.Context, bar Bar) (Baz, error) { - if bar == 0 { - return 0, errors.New("cannot provide baz when bar is zero") + if bar.X == 0 { + return Baz{}, errors.New("cannot provide baz when bar is zero") } return Baz{X: bar.X}, nil }