Skip to content

Commit

Permalink
Expand example.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekSi committed Aug 4, 2019
1 parent 3761186 commit 24dfe97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ via Yandex.Dialogs platform.
# Example

```go
h := alice.NewHandler(func(ctx context.Context, request *alice.Request) (*alice.ResponsePayload, error) {
responder := func(ctx context.Context, request *alice.Request) (*alice.ResponsePayload, error) {
return &alice.ResponsePayload{
Text: "Bye!",
EndSession: true,
}, nil
})
}

h := alice.NewHandler(responder)
h.Errorf = log.Printf
http.Handle("/", h)

Expand Down
5 changes: 3 additions & 2 deletions doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import (
)

func Example() {
h := alice.NewHandler(func(ctx context.Context, request *alice.Request) (*alice.ResponsePayload, error) {
responder := func(ctx context.Context, request *alice.Request) (*alice.ResponsePayload, error) {
return &alice.ResponsePayload{
Text: "Bye!",
EndSession: true,
}, nil
})
}

h := alice.NewHandler(responder)
h.Errorf = log.Printf
http.Handle("/", h)

Expand Down

0 comments on commit 24dfe97

Please sign in to comment.