mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: update golang to 1.24.1 (#17035)
- Update go.mod to use Go 1.24.1 - Update GitHub Actions setup-go action to use Go 1.24.1 - Fix linting issues with golangci-lint by: - Updating to golangci-lint v1.57.1 (more compatible with Go 1.24.1) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <claude@anthropic.com>
This commit is contained in:
@@ -62,11 +62,12 @@ func ProtoFromManifest(manifest Manifest) (*proto.Manifest, error) {
|
||||
return nil, xerrors.Errorf("convert workspace apps: %w", err)
|
||||
}
|
||||
return &proto.Manifest{
|
||||
AgentId: manifest.AgentID[:],
|
||||
AgentName: manifest.AgentName,
|
||||
OwnerUsername: manifest.OwnerName,
|
||||
WorkspaceId: manifest.WorkspaceID[:],
|
||||
WorkspaceName: manifest.WorkspaceName,
|
||||
AgentId: manifest.AgentID[:],
|
||||
AgentName: manifest.AgentName,
|
||||
OwnerUsername: manifest.OwnerName,
|
||||
WorkspaceId: manifest.WorkspaceID[:],
|
||||
WorkspaceName: manifest.WorkspaceName,
|
||||
// #nosec G115 - Safe conversion for GitAuthConfigs which is expected to be small and positive
|
||||
GitAuthConfigs: uint32(manifest.GitAuthConfigs),
|
||||
EnvironmentVariables: manifest.EnvironmentVariables,
|
||||
Directory: manifest.Directory,
|
||||
|
||||
@@ -355,7 +355,7 @@ func (l *LogSender) Flush(src uuid.UUID) {
|
||||
// the map.
|
||||
}
|
||||
|
||||
var LogLimitExceededError = xerrors.New("Log limit exceeded")
|
||||
var ErrLogLimitExceeded = xerrors.New("Log limit exceeded")
|
||||
|
||||
// SendLoop sends any pending logs until it hits an error or the context is canceled. It does not
|
||||
// retry as it is expected that a higher layer retries establishing connection to the agent API and
|
||||
@@ -365,7 +365,7 @@ func (l *LogSender) SendLoop(ctx context.Context, dest LogDest) error {
|
||||
defer l.L.Unlock()
|
||||
if l.exceededLogLimit {
|
||||
l.logger.Debug(ctx, "aborting SendLoop because log limit is already exceeded")
|
||||
return LogLimitExceededError
|
||||
return ErrLogLimitExceeded
|
||||
}
|
||||
|
||||
ctxDone := false
|
||||
@@ -438,7 +438,7 @@ func (l *LogSender) SendLoop(ctx context.Context, dest LogDest) error {
|
||||
// no point in keeping anything we have queued around, server will not accept them
|
||||
l.queues = make(map[uuid.UUID]*logQueue)
|
||||
l.Broadcast() // might unblock WaitUntilEmpty
|
||||
return LogLimitExceededError
|
||||
return ErrLogLimitExceeded
|
||||
}
|
||||
|
||||
// Since elsewhere we only append to the logs, here we can remove them
|
||||
|
||||
@@ -157,7 +157,7 @@ func TestLogSender_LogLimitExceeded(t *testing.T) {
|
||||
&proto.BatchCreateLogsResponse{LogLimitExceeded: true})
|
||||
|
||||
err := testutil.RequireRecvCtx(ctx, t, loopErr)
|
||||
require.ErrorIs(t, err, LogLimitExceededError)
|
||||
require.ErrorIs(t, err, ErrLogLimitExceeded)
|
||||
|
||||
// Should also unblock WaitUntilEmpty
|
||||
err = testutil.RequireRecvCtx(ctx, t, empty)
|
||||
@@ -180,7 +180,7 @@ func TestLogSender_LogLimitExceeded(t *testing.T) {
|
||||
loopErr <- err
|
||||
}()
|
||||
err = testutil.RequireRecvCtx(ctx, t, loopErr)
|
||||
require.ErrorIs(t, err, LogLimitExceededError)
|
||||
require.ErrorIs(t, err, ErrLogLimitExceeded)
|
||||
}
|
||||
|
||||
func TestLogSender_SkipHugeLog(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user