Skip to content

Commit 18e5247

Browse files
committed
Fix linting
1 parent 5687dbe commit 18e5247

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

coderd/httpapi/queryparams_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import (
66
"net/url"
77
"testing"
88

9-
"github.com/coder/coder/coderd/httpapi"
109
"github.com/google/uuid"
1110
"github.com/stretchr/testify/require"
11+
12+
"github.com/coder/coder/coderd/httpapi"
1213
)
1314

1415
type queryParamTestCase[T any] struct {

coderd/httpapi/search.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ func splitElements(query string, delimiter rune) []string {
5959
quoted = !quoted
6060
case delimiter:
6161
if quoted {
62-
current.WriteRune(c)
62+
_, _ = current.WriteRune(c)
6363
} else {
6464
parts = append(parts, current.String())
6565
current = strings.Builder{}
6666
}
6767
default:
68-
current.WriteRune(c)
68+
_, _ = current.WriteRune(c)
6969
}
7070
}
7171
parts = append(parts, current.String())

coderd/httpapi/search_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package httpapi_test
33
import (
44
"testing"
55

6-
"github.com/coder/coder/coderd/httpapi"
76
"github.com/stretchr/testify/require"
7+
8+
"github.com/coder/coder/coderd/httpapi"
89
)
910

1011
func TestSearchWorkspace(t *testing.T) {
@@ -117,7 +118,6 @@ func TestSearchWorkspace(t *testing.T) {
117118
require.NoError(t, err, "expected no error")
118119
require.Equal(t, c.Expected, values, "expected values")
119120
}
120-
121121
})
122122
}
123123
}

coderd/workspaces.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) {
108108
values, err := httpapi.WorkspaceSearchQuery(queryStr)
109109
if err != nil {
110110
httpapi.Write(rw, http.StatusBadRequest, httpapi.Response{
111-
Message: "Invalid workspace search query",
111+
Message: "Invalid workspace search query.",
112112
Validations: []httpapi.Error{
113113
{Field: "q", Detail: err.Error()},
114114
},
@@ -123,7 +123,7 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) {
123123
// outside the query string.
124124
if q.Has(k) {
125125
httpapi.Write(rw, http.StatusBadRequest, httpapi.Response{
126-
Message: fmt.Sprintf("Workspace filter %q cannot be set twice. In query params %q and %q", k, k, "q"),
126+
Message: fmt.Sprintf("Workspace filter %q cannot be set twice. In query params %q and %q.", k, k, "q"),
127127
})
128128
return
129129
}
@@ -152,7 +152,7 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) {
152152
if filter.OwnerUsername == "me" {
153153
if !(filter.OwnerID == uuid.Nil || filter.OwnerID == apiKey.UserID) {
154154
httpapi.Write(rw, http.StatusBadRequest, httpapi.Response{
155-
Message: fmt.Sprintf("Cannot set both \"me\" in \"owner_name\" and use \"owner_id\""),
155+
Message: fmt.Sprintf("Cannot set both \"me\" in \"owner_name\" and use \"owner_id\"."),
156156
})
157157
return
158158
}

0 commit comments

Comments
 (0)