Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
version: "2"

run:
go: '1.19'
deadline: 210s
go: '1.24'
timeout: 10m
skip-dirs:

issues:
exclude-dirs:
- mocks
- '.*_mock'
skip-files:
exclude-files:
- '.*_mock.go'
- ".*\\.pb\\.go$"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NAME = stream-cli

GOLANGCI_VERSION = 1.55.2
GOLANGCI_VERSION = 2.8.0
GOLANGCI = .bin/golangci/$(GOLANGCI_VERSION)/golangci-lint
$(GOLANGCI):
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(dir $(GOLANGCI)) v$(GOLANGCI_VERSION)
Expand Down
56 changes: 50 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,63 @@
module github.com/GetStream/stream-cli

go 1.22
go 1.24

require (
github.com/AlecAivazis/survey/v2 v2.3.4
github.com/GetStream/stream-chat-go/v5 v5.8.1
github.com/MakeNowJust/heredoc v1.0.0
github.com/aws/aws-sdk-go-v2/config v1.32.7
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.21.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.95.1
github.com/cheynewallace/tabby v1.1.1
github.com/gizak/termui/v3 v3.1.0
github.com/gorilla/websocket v1.5.0
github.com/pion/rtp v1.10.0
github.com/pion/webrtc/v4 v4.2.3
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.11.0
)

require (
github.com/aws/aws-sdk-go-v2 v1.41.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.7 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.17 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.8 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.17 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.17 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.0.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.30.9 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.13 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.41.6 // indirect
github.com/aws/smithy-go v1.24.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/pion/datachannel v1.6.0 // indirect
github.com/pion/dtls/v3 v3.0.10 // indirect
github.com/pion/ice/v4 v4.2.0 // indirect
github.com/pion/interceptor v0.1.43 // indirect
github.com/pion/logging v0.2.4 // indirect
github.com/pion/mdns/v2 v2.1.0 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.16 // indirect
github.com/pion/sctp v1.9.2 // indirect
github.com/pion/sdp/v3 v3.0.17 // indirect
github.com/pion/srtp/v3 v3.0.10 // indirect
github.com/pion/stun/v3 v3.1.1 // indirect
github.com/pion/transport/v4 v4.0.1 // indirect
github.com/pion/turn/v4 v4.1.4 // indirect
github.com/wlynxg/anet v0.0.5 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/time v0.10.0 // indirect
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -38,12 +82,12 @@ require (
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stretchr/testify v1.7.1
github.com/stretchr/testify v1.11.1
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 // indirect
golang.org/x/text v0.3.8 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
106 changes: 96 additions & 10 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/cmd/chat/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ func hideCmd() *cobra.Command {
return err
}

cmd.Printf("Successfully hid channel for " + userID + "\n")
cmd.Printf("Successfully hid channel for %s\n", userID)
return nil
},
}
Expand Down
12 changes: 9 additions & 3 deletions pkg/cmd/chat/imports/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ func validateFile(cmd *cobra.Command, c *stream.Client, filename string) (*valid
if err != nil {
return nil, err
}
defer reader.Close()
defer func() {
_ = reader.Close()
}()

rolesResp, err := c.Permissions().ListRoles(cmd.Context())
if err != nil {
Expand Down Expand Up @@ -85,7 +87,9 @@ func uploadToS3(ctx context.Context, filename, url string) error {
if err != nil {
return err
}
defer data.Close()
defer func() {
_ = data.Close()
}()

stat, err := data.Stat()
if err != nil {
Expand All @@ -103,7 +107,9 @@ func uploadToS3(ctx context.Context, filename, url string) error {
if err != nil {
return err
}
defer resp.Body.Close()
defer func() {
_ = resp.Body.Close()
}()

return nil
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/cmd/chat/imports/validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ func TestValidator_Validate(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
f, err := os.Open("testdata/" + tt.filename)
require.NoError(t, err)
defer f.Close()
defer func() {
_ = f.Close()
}()

var options []Options
if tt.lighterChanIDValidation {
Expand Down
4 changes: 3 additions & 1 deletion pkg/cmd/chat/utils/fileupload.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func uploadFile(c *stream.Client, cmd *cobra.Command, uploadtype uploadType, chT
if err != nil {
return "", err
}
defer file.Close()
defer func() {
_ = file.Close()
}()

req := stream.SendFileRequest{
User: &stream.User{ID: userID},
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/url"
"text/tabwriter"

"github.com/AlecAivazis/survey/v2"
survey "github.com/AlecAivazis/survey/v2"
"github.com/MakeNowJust/heredoc"
"github.com/cheynewallace/tabby"
"github.com/spf13/cobra"
Expand Down
Loading