Skip to content

Commit

Permalink
Address go vet complaints (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
sahil-lakhwani authored and PrasadG193 committed Jan 14, 2020
1 parent 9ed1d9d commit 4f397b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion connector/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (client *ConnectorClient) getToken() (string, error) {
a := &schema.AuthResponse{}
err = json.NewDecoder(resp.Body).Decode(a)
if err != nil {
return "", fmt.Errorf("Invalid activity to send", err)
return "", fmt.Errorf("Invalid activity to send %s", err)
}

return a.AccessToken, nil
Expand Down
16 changes: 9 additions & 7 deletions core/bot_framework_adapter_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package core_test

import (
"context"
"fmt"
"os"

"github.com/infracloudio/msbotbuilder-go/core"
"github.com/infracloudio/msbotbuilder-go/core/activity"
"github.com/infracloudio/msbotbuilder-go/schema"
"os"
)

func Example() {
Expand All @@ -17,7 +19,7 @@ func Example() {
}

// Make an adapter to perform operations with the Bot Framework using this library.
adapter = core.NewBotAdapter(setting)
adapter := core.NewBotAdapter(setting)

// Create a handler that defines operations to be performed on respective events.
// Following defines the operation to be performed on the 'message' event.
Expand All @@ -32,15 +34,15 @@ func Example() {
// activity depicts a request as received from a client
activity := schema.Activity{
Type: schema.Message,
From: &schema.ChannelAccount{
From: schema.ChannelAccount{
ID: "12345678",
Name: "Pepper's News Feed",
},
Conversation: &schema.ConversationAccount{
Conversation: schema.ConversationAccount{
ID: "abcd1234",
Name: "Convo1",
},
Recipient: &schema.ChannelAccount{
Recipient: schema.ChannelAccount{
ID: "1234abcd",
Name: "SteveW",
},
Expand All @@ -49,10 +51,10 @@ func Example() {
}

// Pass the activity and handler to the adapter for proecssing
err = adapter.ProcessActivity(ctx, activity, customHandler)
ctx := context.Background()
err := adapter.ProcessActivity(ctx, activity, customHandler)
if err != nil {
fmt.Println("Failed to process request", err)
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
}
1 change: 0 additions & 1 deletion hack/verify-govet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ set -o pipefail
go vet ./core/...
go vet ./schema/...
go vet ./connector/...
go vet ./protocol/...

0 comments on commit 4f397b7

Please sign in to comment.