Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2611f51

Browse files
committed
lint
1 parent4db2488 commit2611f51

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

‎cli/trafficgen.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import (
88
"sync/atomic"
99
"time"
1010

11+
"github.com/google/uuid"
12+
"golang.org/x/xerrors"
13+
1114
"github.com/coder/coder/cli/clibase"
1215
"github.com/coder/coder/codersdk"
1316
"github.com/coder/coder/cryptorand"
14-
"github.com/google/uuid"
15-
"golang.org/x/xerrors"
1617
)
1718

1819
func (r*RootCmd)trafficGen()*clibase.Cmd {
@@ -76,9 +77,12 @@ func (r *RootCmd) trafficGen() *clibase.Cmd {
7677
Data:"#",
7778
})
7879
iferr!=nil {
79-
returnxerrors.Errorf("write comment to pty: %w",err)
80+
returnxerrors.Errorf("serialize request: %w",err)
8081
}
8182
_,err=crw.Write(data)
83+
iferr!=nil {
84+
returnxerrors.Errorf("write comment to pty: %w",err)
85+
}
8286
// Now we begin writing random data to the pty.
8387
writeSize:=int(bps/10)
8488
rch:=make(chanerror)
@@ -176,7 +180,7 @@ func copyContext(ctx context.Context, dst io.Writer, src []byte) error {
176180
default:
177181
_,err:=dst.Write(src[idx :idx+1])
178182
iferr!=nil {
179-
iferr==io.EOF {
183+
ifxerrors.Is(err,io.EOF) {
180184
returnnil
181185
}
182186
returnerr

‎cli/trafficgen_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ import (
66
"strings"
77
"testing"
88

9+
"github.com/google/uuid"
10+
"github.com/stretchr/testify/require"
11+
912
"github.com/coder/coder/agent"
1013
"github.com/coder/coder/cli/clitest"
1114
"github.com/coder/coder/coderd/coderdtest"
1215
"github.com/coder/coder/codersdk/agentsdk"
1316
"github.com/coder/coder/provisioner/echo"
1417
"github.com/coder/coder/provisionersdk/proto"
1518
"github.com/coder/coder/testutil"
16-
"github.com/google/uuid"
17-
"github.com/stretchr/testify/require"
1819
)
1920

2021
// This test pretends to stand up a workspace and run a no-op traffic generation test.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp