Skip to content

Commit 9ae5514

Browse files
committed
fix more stuff
1 parent 1530bfb commit 9ae5514

File tree

8 files changed

+14
-24
lines changed

8 files changed

+14
-24
lines changed

cmd/coder/main.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11
package main
22

33
import (
4-
"fmt"
5-
"os"
64
_ "time/tzdata"
75

8-
tea "github.com/charmbracelet/bubbletea"
9-
10-
"github.com/coder/coder/v2/agent/agentexec"
116
_ "github.com/coder/coder/v2/buildinfo/resources"
127
"github.com/coder/coder/v2/cli"
138
)
149

1510
func main() {
1611
panic("hey")
17-
if len(os.Args) > 1 && os.Args[1] == "agent-exec" {
18-
err := agentexec.CLI()
19-
_, _ = fmt.Fprintln(os.Stderr, err)
20-
os.Exit(1)
21-
}
12+
2213
// This preserves backwards compatibility with an init function that is causing grief for
2314
// web terminals using agent-exec + screen. See https://github.com/coder/coder/pull/15817
24-
tea.InitTerminal()
15+
2516
var rootCmd cli.RootCmd
2617
rootCmd.RunWithSubcommands(rootCmd.AGPL())
2718
}

coderd/apikey.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,12 @@ func (api *API) tokens(rw http.ResponseWriter, r *http.Request) {
257257
return
258258
}
259259

260-
var userIds []uuid.UUID
260+
var userIDs []uuid.UUID
261261
for _, key := range keys {
262-
userIds = append(userIds, key.UserID)
262+
userIDs = append(userIDs, key.UserID)
263263
}
264264

265-
users, _ := api.Database.GetUsersByIDs(ctx, userIds)
265+
users, _ := api.Database.GetUsersByIDs(ctx, userIDs)
266266
usersByID := map[uuid.UUID]database.User{}
267267
for _, user := range users {
268268
usersByID[user.ID] = user

coderd/apikey/apikey_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,4 @@ func TestGenerate(t *testing.T) {
173173
}
174174
})
175175
}
176-
}
176+
}

coderd/coderd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ func New(options *Options) *API {
14211421
// global variable here.
14221422
r.Get("/swagger/*", globalHTTPSwaggerHandler)
14231423
} else {
1424-
swaggerDisabled := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
1424+
swaggerDisabled := http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) {
14251425
httpapi.Write(context.Background(), rw, http.StatusNotFound, codersdk.Response{
14261426
Message: "Swagger documentation is disabled.",
14271427
})

coderd/workspaceupdates.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ func (s *sub) handleEvent(ctx context.Context, event wspubsub.WorkspaceEvent, er
7070
default:
7171
if err == nil {
7272
return
73-
} else {
74-
// Always attempt an update if the pubsub lost connection
75-
s.logger.Warn(ctx, "failed to handle workspace event", slog.Error(err))
7673
}
74+
// Always attempt an update if the pubsub lost connection
75+
s.logger.Warn(ctx, "failed to handle workspace event", slog.Error(err))
7776
}
7877

7978
// Use context containing actor

enterprise/coderd/notifications.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (api *API) updateNotificationTemplateMethod(rw http.ResponseWriter, r *http
7575

7676
err := api.Database.InTx(func(tx database.Store) error {
7777
var err error
78-
template, err = api.Database.UpdateNotificationTemplateMethodByID(r.Context(), database.UpdateNotificationTemplateMethodByIDParams{
78+
template, err = tx.UpdateNotificationTemplateMethodByID(r.Context(), database.UpdateNotificationTemplateMethodByIDParams{
7979
ID: template.ID,
8080
Method: nm,
8181
})

enterprise/wsproxy/wsproxy.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,13 +398,13 @@ func New(ctx context.Context, opts *Options) (*Server, error) {
398398
r.Route("/derp", func(r chi.Router) {
399399
r.Get("/", derpHandler.ServeHTTP)
400400
// This is used when UDP is blocked, and latency must be checked via HTTP(s).
401-
r.Get("/latency-check", func(w http.ResponseWriter, r *http.Request) {
401+
r.Get("/latency-check", func(w http.ResponseWriter, _ *http.Request) {
402402
w.WriteHeader(http.StatusOK)
403403
})
404404
})
405405
} else {
406406
r.Route("/derp", func(r chi.Router) {
407-
r.HandleFunc("/*", func(rw http.ResponseWriter, r *http.Request) {
407+
r.HandleFunc("/*", func(rw http.ResponseWriter, _ *http.Request) {
408408
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
409409
Message: "DERP is disabled on this proxy.",
410410
})
@@ -413,7 +413,7 @@ func New(ctx context.Context, opts *Options) (*Server, error) {
413413
}
414414

415415
r.Get("/api/v2/buildinfo", s.buildInfo)
416-
r.Get("/healthz", func(w http.ResponseWriter, r *http.Request) { _, _ = w.Write([]byte("OK")) })
416+
r.Get("/healthz", func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte("OK")) })
417417
// TODO: @emyrk should this be authenticated or debounced?
418418
r.Get("/healthz-report", s.healthReport)
419419
r.NotFound(func(rw http.ResponseWriter, r *http.Request) {

scripts/testidp/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func main() {
3838
flag.Parse()
3939

4040
// This is just a way to run tests outside go test
41-
testing.Main(func(pat, str string) (bool, error) {
41+
testing.Main(func(_, _ string) (bool, error) {
4242
return true, nil
4343
}, []testing.InternalTest{
4444
{

0 commit comments

Comments
 (0)