Skip to content

Commit 9fd4ddb

Browse files
committed
fix lint
1 parent 7747f2d commit 9fd4ddb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

coderd/workspaceagents.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,19 +259,19 @@ func (api *API) patchWorkspaceAgentStartupLogs(rw http.ResponseWriter, r *http.R
259259
output := make([]string, 0)
260260
level := make([]database.LogLevel, 0)
261261
outputLength := 0
262-
for _, log := range req.Logs {
263-
createdAt = append(createdAt, log.CreatedAt)
264-
output = append(output, log.Output)
265-
outputLength += len(log.Output)
266-
if log.Level == "" {
262+
for _, logEntry := range req.Logs {
263+
createdAt = append(createdAt, logEntry.CreatedAt)
264+
output = append(output, logEntry.Output)
265+
outputLength += len(logEntry.Output)
266+
if logEntry.Level == "" {
267267
// Default to "info" to support older agents that didn't have the level field.
268-
log.Level = codersdk.LogLevelInfo
268+
logEntry.Level = codersdk.LogLevelInfo
269269
}
270-
parsedLevel := database.LogLevel(log.Level)
270+
parsedLevel := database.LogLevel(logEntry.Level)
271271
if !parsedLevel.Valid() {
272272
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
273273
Message: "Invalid log level provided.",
274-
Detail: fmt.Sprintf("invalid log level: %q", log.Level),
274+
Detail: fmt.Sprintf("invalid log level: %q", logEntry.Level),
275275
})
276276
return
277277
}

0 commit comments

Comments
 (0)