From bd34d394016d772a41102e03f2dc6efa0b20d34c Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 26 Oct 2017 12:02:52 +0100 Subject: [PATCH] update readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 00c318bd..8f4c380d 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,7 @@ Go-micro includes the notion of middleware as wrappers. The client or handlers c Here's an example service handler wrapper which logs the incoming request -``` +```go // implements the server.HandlerWrapper func logWrapper(fn server.HandlerFunc) server.HandlerFunc { return func(ctx context.Context, req server.Request, rsp interface{}) error { @@ -339,7 +339,7 @@ func logWrapper(fn server.HandlerFunc) server.HandlerFunc { It can be initialised when creating the service -``` +```go service := micro.NewService( micro.Name("greeter"), // wrap the handler @@ -351,7 +351,7 @@ service := micro.NewService( Here's an example of a client wrapper which logs requests made -``` +```go type logWrapper struct { client.Client } @@ -369,7 +369,7 @@ func logWrap(c client.Client) client.Client { It can be initialised when creating the service -``` +```go service := micro.NewService( micro.Name("greeter"), // wrap the client