Skip to content

Commit 9df08f7

Browse files
committed
make lint; make fmt
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 0a94405 commit 9df08f7

File tree

5 files changed

+223
-219
lines changed

5 files changed

+223
-219
lines changed

cli/agent.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cli
22

33
import (
44
"context"
5-
"errors"
65
"fmt"
76
"io"
87
"net/http"
@@ -16,10 +15,11 @@ import (
1615
"time"
1716

1817
"cloud.google.com/go/compute/metadata"
19-
"github.com/coder/retry"
2018
"golang.org/x/xerrors"
2119
"gopkg.in/natefinch/lumberjack.v2"
2220

21+
"github.com/coder/retry"
22+
2323
"github.com/prometheus/client_golang/prometheus"
2424

2525
"cdr.dev/slog"
@@ -66,8 +66,7 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
6666
Handler: func(inv *serpent.Invocation) error {
6767
ctx, cancel := context.WithCancelCause(inv.Context())
6868
defer func() {
69-
fmt.Printf(">>>>>CANCELING CONTEXT")
70-
cancel(errors.New("defer"))
69+
cancel(xerrors.New("defer"))
7170
}()
7271

7372
var (

coderd/workspaceagents.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ func (api *API) workspaceAgentReinit(rw http.ResponseWriter, r *http.Request) {
10701070
workspace, err := api.Database.GetWorkspaceByAgentID(ctx, workspaceAgent.ID)
10711071
if err != nil {
10721072
log.Error(ctx, "failed to retrieve workspace from agent token", slog.Error(err))
1073-
httpapi.InternalServerError(rw, errors.New("failed to determine workspace from agent token"))
1073+
httpapi.InternalServerError(rw, xerrors.New("failed to determine workspace from agent token"))
10741074
}
10751075

10761076
log.Info(ctx, "agent waiting for reinit instruction")
@@ -1094,7 +1094,7 @@ func (api *API) workspaceAgentReinit(rw http.ResponseWriter, r *http.Request) {
10941094
})
10951095
if err != nil {
10961096
log.Error(ctx, "failed to subscribe to prebuild claimed channel", slog.Error(err))
1097-
httpapi.InternalServerError(rw, errors.New("failed to subscribe to prebuild claimed channel"))
1097+
httpapi.InternalServerError(rw, xerrors.New("failed to subscribe to prebuild claimed channel"))
10981098
return
10991099
}
11001100
defer cancelSub()

provisioner/terraform/executor.go

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import (
1515
"sync"
1616
"time"
1717

18+
"github.com/coder/terraform-provider-coder/provider"
19+
1820
"github.com/hashicorp/go-version"
1921
tfjson "github.com/hashicorp/terraform-json"
2022
"go.opentelemetry.io/otel/attribute"

0 commit comments

Comments
 (0)