Skip to content

Commit

Permalink
docs:format code
Browse files Browse the repository at this point in the history
  • Loading branch information
bootun committed Jan 16, 2022
1 parent 2e309c4 commit 95d26e3
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ package service

// HelloService describes the service.
type HelloService interface {
// Add your methods here
// e.x: Foo(ctx context.Context,s string)(rs string, err error)
// Add your methods here
// e.x: Foo(ctx context.Context,s string)(rs string, err error)
}
```
When you are generating the service and the client library, the module name in the go.mod file could be autodetected.
Expand Down Expand Up @@ -101,25 +101,25 @@ This will generate the client library :sparkles: `http/client/http/http.go` that
package main

import (
"context"
"fmt"
"context"
"fmt"

client "hello/client/http"
"github.com/go-kit/kit/transport/http"
client "hello/client/http"
"github.com/go-kit/kit/transport/http"
)

func main() {
svc, err := client.New("http://localhost:8081", map[string][]http.ClientOption{})
if err != nil {
panic(err)
}

r, err := svc.Foo(context.Background(), "hello")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Result:", r)
svc, err := client.New("http://localhost:8081", map[string][]http.ClientOption{})
if err != nil {
panic(err)
}

r, err := svc.Foo(context.Background(), "hello")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Result:", r)
}
```
# Generate new middleware
Expand Down

0 comments on commit 95d26e3

Please sign in to comment.