Skip to content

Commit 175f9ab

Browse files
committed
all: fix some staticcheck warnings
1 parent ca0a4c5 commit 175f9ab

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

ai-chat/chat/provider/local/datasource.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ func (d *DataSource) GetChannel(ctx context.Context, id string) (*db.Channel, er
3737
func (d *DataSource) GetChannelUsers(ctx context.Context, c *db.Channel) ([]*db.User, []*botdb.Bot, error) {
3838
q := db.New()
3939
members, err := q.ListUsersInChannel(ctx, chatDb.Stdlib(), c.ID)
40+
if err != nil {
41+
return nil, nil, errors.Wrap(err, "list users in channel")
42+
}
4043
botUsers := fns.Filter(members, func(m *db.User) bool { return m.BotID != nil })
4144
botsIds := fns.Map(botUsers, func(m *db.User) uuid.UUID { return *m.BotID })
4245
if len(botsIds) == 0 {

ai-chat/llm/provider/provider.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ func (s *ChatRequest) processLine(ctx context.Context, line string) error {
208208
Type: BotMessageTypeTyping,
209209
}},
210210
})
211+
if err != nil {
212+
rlog.Warn("publish message", "error", err)
213+
}
214+
211215
// Simulate the bot typing
212216
randBackoff := time.Duration(rand.IntN(1000)) * time.Millisecond
213217
time.Sleep(randBackoff + time.Duration(len(msg)*40)*time.Millisecond)

ai-chat/proxy/proxy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var BaseURL = func() url.URL {
2929
}
3030
rlog.Info("Starting ngrok")
3131
ngrokCtx, cancel := context.WithCancel(ctx)
32+
defer cancel()
3233
sessChan := make(chan ngrok.Session)
3334
var session ngrok.Session
3435
go func() {

multi-service-saas/billing/billing.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package billing
33

44
import (
55
"context"
6-
"fmt"
76
"time"
87

98
"encore.app/user"
@@ -91,7 +90,7 @@ func Upgrade(ctx context.Context, req *UpgradeRequest) (*SubscriptionInfo, error
9190
if !valid[req.Plan] {
9291
return nil, &errs.Error{
9392
Code: errs.InvalidArgument,
94-
Message: fmt.Sprintf("plan must be one of: free, pro, enterprise"),
93+
Message: "plan must be one of: free, pro, enterprise",
9594
}
9695
}
9796

0 commit comments

Comments
 (0)