Skip to content

chore: update golang to 1.24.1 #17035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5df49f9
feat: update Go version to 1.24.1
Mar 21, 2025
83e79be
refactor: simplify Go 1.24.1 update
Mar 21, 2025
57a47e0
revert: simplify change to go version only
Mar 21, 2025
8187c9e
fix: update guts dependency to support Go 1.24.1
Mar 21, 2025
5aaf404
fix: update golangci-lint tool for Go 1.24.1
Mar 21, 2025
d7160ae
fix: temporarily disable Go linting due to Go 1.24.1 compatibility is…
Mar 21, 2025
3c3aa21
fix: update golangci-lint to v1.57.1 for Go 1.24.1 compatibility
Mar 21, 2025
4710808
fix: upgrade golangci-lint to v1.64.8
Mar 21, 2025
2bcb38a
revert: restore original lint/go implementation in Makefile
Mar 21, 2025
651d489
fix: restore original Makefile structure with continue-on-error for l…
Mar 21, 2025
77b2908
chore: remove continue-on-error behavior from lint/go
Mar 21, 2025
226e838
update golangci rules
sreya Mar 24, 2025
02fd64a
fix config
sreya Mar 24, 2025
3d07833
ignore unused parameters in tests
sreya Mar 25, 2025
75be2c3
update golangci rules
sreya Mar 25, 2025
2b19287
more updates
sreya Mar 25, 2025
ee44d98
fix: Add #nosec G115 annotations to address integer overflow conversi…
sreya Mar 25, 2025
f8af6a8
fix: Add more #nosec G115 annotations for integer overflow warnings
sreya Mar 25, 2025
3cf7102
fix: address G115 integer overflow linter warnings for Go 1.24.1
sreya Mar 25, 2025
527df65
fix: address more G115 integer overflow linter warnings
sreya Mar 25, 2025
7d11352
refactor: replace if-else chains with switch statements
sreya Mar 25, 2025
59e1b9c
fix: resolve unused parameter linter issues for Go 1.24.1 compatibility
sreya Mar 25, 2025
bb5aa17
fix: resolve unused-parameter warnings for Go 1.24.1 compatibility
sreya Mar 26, 2025
0b3571a
errname and fix changes
sreya Mar 26, 2025
7f93228
more fixes
sreya Mar 26, 2025
792b4b5
fix compilation error
sreya Mar 26, 2025
a4f441a
fix: resolve G115 integer overflow conversion warnings for Go 1.24.1 …
sreya Mar 26, 2025
5caf54d
fix: convert if-else chains to switch statements for Go 1.24.1 compat…
sreya Mar 26, 2025
d9b665c
fix abhorrent edits
sreya Mar 26, 2025
7e0ceec
fix more linting rules
sreya Mar 26, 2025
1530bfb
fix agent
sreya Mar 26, 2025
9ae5514
fix more stuff
sreya Mar 26, 2025
e2e1e17
fix test
sreya Mar 26, 2025
f3f5755
fix: resolve remaining redefines-builtin-id linting issues
sreya Mar 26, 2025
9b0a218
fix appendAssign
sreya Mar 26, 2025
d3581a8
fix: resolve deferUnlambda linting issues by simplifying defer statem…
sreya Mar 26, 2025
1bb7942
fix ifelse
sreya Mar 26, 2025
31311d3
fix assignOp linting errors
Mar 26, 2025
3b93057
Revert "fix: resolve deferUnlambda linting issues by simplifying defe…
sreya Mar 26, 2025
3a4ac1e
unlambda && make gen
sreya Mar 26, 2025
38de0cf
don't commit dbmock
sreya Mar 26, 2025
3afeb90
make gen
sreya Mar 26, 2025
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
Prev Previous commit
Next Next commit
fix more stuff
  • Loading branch information
sreya committed Mar 26, 2025
commit 9ae5514ff4a66a9437e7b0cb95e0ee55cbd1bf23
13 changes: 2 additions & 11 deletions cmd/coder/main.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
package main

import (
"fmt"
"os"
_ "time/tzdata"

tea "github.com/charmbracelet/bubbletea"

"github.com/coder/coder/v2/agent/agentexec"
_ "github.com/coder/coder/v2/buildinfo/resources"
"github.com/coder/coder/v2/cli"
)

func main() {
panic("hey")
if len(os.Args) > 1 && os.Args[1] == "agent-exec" {
err := agentexec.CLI()
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}

// This preserves backwards compatibility with an init function that is causing grief for
// web terminals using agent-exec + screen. See https://github.com/coder/coder/pull/15817
tea.InitTerminal()

var rootCmd cli.RootCmd
rootCmd.RunWithSubcommands(rootCmd.AGPL())
}
6 changes: 3 additions & 3 deletions coderd/apikey.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ func (api *API) tokens(rw http.ResponseWriter, r *http.Request) {
return
}

var userIds []uuid.UUID
var userIDs []uuid.UUID
for _, key := range keys {
userIds = append(userIds, key.UserID)
userIDs = append(userIDs, key.UserID)
}

users, _ := api.Database.GetUsersByIDs(ctx, userIds)
users, _ := api.Database.GetUsersByIDs(ctx, userIDs)
usersByID := map[uuid.UUID]database.User{}
for _, user := range users {
usersByID[user.ID] = user
Expand Down
2 changes: 1 addition & 1 deletion coderd/apikey/apikey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ func TestGenerate(t *testing.T) {
}
})
}
}
}
2 changes: 1 addition & 1 deletion coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ func New(options *Options) *API {
// global variable here.
r.Get("/swagger/*", globalHTTPSwaggerHandler)
} else {
swaggerDisabled := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
swaggerDisabled := http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) {
httpapi.Write(context.Background(), rw, http.StatusNotFound, codersdk.Response{
Message: "Swagger documentation is disabled.",
})
Expand Down
5 changes: 2 additions & 3 deletions coderd/workspaceupdates.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ func (s *sub) handleEvent(ctx context.Context, event wspubsub.WorkspaceEvent, er
default:
if err == nil {
return
} else {
// Always attempt an update if the pubsub lost connection
s.logger.Warn(ctx, "failed to handle workspace event", slog.Error(err))
}
// Always attempt an update if the pubsub lost connection
s.logger.Warn(ctx, "failed to handle workspace event", slog.Error(err))
}

// Use context containing actor
Expand Down
2 changes: 1 addition & 1 deletion enterprise/coderd/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (api *API) updateNotificationTemplateMethod(rw http.ResponseWriter, r *http

err := api.Database.InTx(func(tx database.Store) error {
var err error
template, err = api.Database.UpdateNotificationTemplateMethodByID(r.Context(), database.UpdateNotificationTemplateMethodByIDParams{
template, err = tx.UpdateNotificationTemplateMethodByID(r.Context(), database.UpdateNotificationTemplateMethodByIDParams{
ID: template.ID,
Method: nm,
})
Expand Down
6 changes: 3 additions & 3 deletions enterprise/wsproxy/wsproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,13 @@ func New(ctx context.Context, opts *Options) (*Server, error) {
r.Route("/derp", func(r chi.Router) {
r.Get("/", derpHandler.ServeHTTP)
// This is used when UDP is blocked, and latency must be checked via HTTP(s).
r.Get("/latency-check", func(w http.ResponseWriter, r *http.Request) {
r.Get("/latency-check", func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
})
})
} else {
r.Route("/derp", func(r chi.Router) {
r.HandleFunc("/*", func(rw http.ResponseWriter, r *http.Request) {
r.HandleFunc("/*", func(rw http.ResponseWriter, _ *http.Request) {
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: "DERP is disabled on this proxy.",
})
Expand All @@ -413,7 +413,7 @@ func New(ctx context.Context, opts *Options) (*Server, error) {
}

r.Get("/api/v2/buildinfo", s.buildInfo)
r.Get("/healthz", func(w http.ResponseWriter, r *http.Request) { _, _ = w.Write([]byte("OK")) })
r.Get("/healthz", func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte("OK")) })
// TODO: @emyrk should this be authenticated or debounced?
r.Get("/healthz-report", s.healthReport)
r.NotFound(func(rw http.ResponseWriter, r *http.Request) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/testidp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func main() {
flag.Parse()

// This is just a way to run tests outside go test
testing.Main(func(pat, str string) (bool, error) {
testing.Main(func(_, _ string) (bool, error) {
return true, nil
}, []testing.InternalTest{
{
Expand Down
Loading