Skip to content

Commit 9b0a218

Browse files
sreyaClaude
authored and
Claude
committed
fix appendAssign
1 parent f3f5755 commit 9b0a218

File tree

9 files changed

+14
-4
lines changed

9 files changed

+14
-4
lines changed

agent/reconnectingpty/buffered.go

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func newBuffered(ctx context.Context, logger slog.Logger, execer agentexec.Exece
6060
// Add TERM then start the command with a pty. pty.Cmd duplicates Path as the
6161
// first argument so remove it.
6262
cmdWithEnv := execer.PTYCommandContext(ctx, cmd.Path, cmd.Args[1:]...)
63+
//nolint:gocritic
6364
cmdWithEnv.Env = append(rpty.command.Env, "TERM=xterm-256color")
6465
cmdWithEnv.Dir = rpty.command.Dir
6566
ptty, process, err := pty.Start(cmdWithEnv)

agent/reconnectingpty/screen.go

+2
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ func (rpty *screenReconnectingPTY) doAttach(ctx context.Context, conn net.Conn,
225225
rpty.command.Path,
226226
// pty.Cmd duplicates Path as the first argument so remove it.
227227
}, rpty.command.Args[1:]...)...)
228+
//nolint:gocritic
228229
cmd.Env = append(rpty.command.Env, "TERM=xterm-256color")
229230
cmd.Dir = rpty.command.Dir
230231
ptty, process, err := pty.Start(cmd, pty.WithPTYOption(
@@ -340,6 +341,7 @@ func (rpty *screenReconnectingPTY) sendCommand(ctx context.Context, command stri
340341
// -X runs a command in the matching session.
341342
"-X", command,
342343
)
344+
//nolint:gocritic
343345
cmd.Env = append(rpty.command.Env, "TERM=xterm-256color")
344346
cmd.Dir = rpty.command.Dir
345347
cmd.Stdout = &stdout

cli/agent.go

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
127127
logger.Info(ctx, "spawning reaper process")
128128
// Do not start a reaper on the child process. It's important
129129
// to do this else we fork bomb ourselves.
130+
//nolint:gocritic
130131
args := append(os.Args, "--no-reap")
131132
err := reaper.ForkReap(
132133
reaper.WithExecArgs(args...),

cli/clitest/golden.go

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func TestCommandHelp(t *testing.T, getRoot func(t *testing.T) *serpent.Command,
5858
ExtractCommandPathsLoop:
5959
for _, cp := range extractVisibleCommandPaths(nil, root.Children) {
6060
name := fmt.Sprintf("coder %s --help", strings.Join(cp, " "))
61+
//nolint:gocritic
6162
cmd := append(cp, "--help")
6263
for _, tt := range cases {
6364
if tt.Name == name {

cli/server_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -1701,6 +1701,7 @@ func TestServer(t *testing.T) {
17011701
// Next, we instruct the same server to display the YAML config
17021702
// and then save it.
17031703
inv = inv.WithContext(testutil.Context(t, testutil.WaitMedium))
1704+
//nolint:gocritic
17041705
inv.Args = append(args, "--write-config")
17051706
fi, err := os.OpenFile(testutil.TempFile(t, "", "coder-config-test-*"), os.O_WRONLY|os.O_CREATE, 0o600)
17061707
require.NoError(t, err)

cli/templatepush_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ func TestTemplatePush(t *testing.T) {
723723
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, templateVersion.ID)
724724

725725
// Test the cli command.
726+
//nolint:gocritic
726727
modifiedTemplateVariables := append(initialTemplateVariables,
727728
&proto.TemplateVariable{
728729
Name: "second_variable",
@@ -792,6 +793,7 @@ func TestTemplatePush(t *testing.T) {
792793
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, templateVersion.ID)
793794

794795
// Test the cli command.
796+
//nolint:gocritic
795797
modifiedTemplateVariables := append(initialTemplateVariables,
796798
&proto.TemplateVariable{
797799
Name: "second_variable",
@@ -839,6 +841,7 @@ func TestTemplatePush(t *testing.T) {
839841
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, templateVersion.ID)
840842

841843
// Test the cli command.
844+
//nolint:gocritic
842845
modifiedTemplateVariables := append(initialTemplateVariables,
843846
&proto.TemplateVariable{
844847
Name: "second_variable",
@@ -905,6 +908,7 @@ func TestTemplatePush(t *testing.T) {
905908
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, templateVersion.ID)
906909

907910
// Test the cli command.
911+
//nolint:gocritic
908912
modifiedTemplateVariables := append(initialTemplateVariables,
909913
&proto.TemplateVariable{
910914
Name: "second_variable",

coderd/database/dbauthz/dbauthz.go

+2
Original file line numberDiff line numberDiff line change
@@ -3212,6 +3212,7 @@ func (q *querier) InsertOrganizationMember(ctx context.Context, arg database.Ins
32123212
}
32133213

32143214
// All roles are added roles. Org member is always implied.
3215+
//nolint:gocritic
32153216
addedRoles := append(orgRoles, rbac.ScopedRoleOrgMember(arg.OrganizationID))
32163217
err = q.canAssignRoles(ctx, arg.OrganizationID, addedRoles, []rbac.RoleIdentifier{})
32173218
if err != nil {
@@ -3796,6 +3797,7 @@ func (q *querier) UpdateMemberRoles(ctx context.Context, arg database.UpdateMemb
37963797
}
37973798

37983799
// The org member role is always implied.
3800+
//nolint:gocritic
37993801
impliedTypes := append(scopedGranted, rbac.ScopedRoleOrgMember(arg.OrgID))
38003802

38013803
added, removed := rbac.ChangeRoleSet(originalRoles, impliedTypes)

coderd/database/migrations/migrate_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (s *tableStats) Add(table string, n int) {
199199
s.mu.Lock()
200200
defer s.mu.Unlock()
201201

202-
s.s[table] = s.s[table] + n
202+
s.s[table] += n
203203
}
204204

205205
func (s *tableStats) Empty() []string {

support/support.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,9 @@ func WorkspaceInfo(ctx context.Context, client *codersdk.Client, log slog.Logger
241241
return xerrors.Errorf("fetch provisioner job logs: %w", err)
242242
}
243243
defer closer.Close()
244-
var logs []codersdk.ProvisionerJobLog
245244
for log := range buildLogCh {
246-
logs = append(w.BuildLogs, log)
245+
w.BuildLogs = append(w.BuildLogs, log)
247246
}
248-
w.BuildLogs = logs
249247
return nil
250248
})
251249

0 commit comments

Comments
 (0)