Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitce4039a

Browse files
committed
fixup! add make lint to Makefile
1 parent528ce6d commitce4039a

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

‎Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ site/out:
8989
git checkout HEAD site/out
9090
.PHONY: site/out
9191

92-
lint/go:
92+
lint:
9393
@echo"--- golangci-lint"
9494
golangci-lint run
95-
.PHONY: lint/go
96-
97-
lint: lint/go
9895
.PHONY: lint

‎coderd/provisionerjobs.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ func (api *api) provisionerJobLogs(rw http.ResponseWriter, r *http.Request, job
138138
// See: https://canjs.com/doc/can-ndjson-stream.html
139139
rw.Header().Set("Content-Type","application/stream+json")
140140
rw.WriteHeader(http.StatusOK)
141-
tryFlush(rw)
141+
ifflusher,ok:=rw.(http.Flusher);ok {
142+
flusher.Flush()
143+
}
142144

143145
// The Go stdlib JSON encoder appends a newline character after message write.
144146
encoder:=json.NewEncoder(rw)
@@ -161,7 +163,9 @@ func (api *api) provisionerJobLogs(rw http.ResponseWriter, r *http.Request, job
161163
iferr!=nil {
162164
return
163165
}
164-
tryFlush(rw)
166+
ifflusher,ok:=rw.(http.Flusher);ok {
167+
flusher.Flush()
168+
}
165169
case<-ticker.C:
166170
job,err:=api.Database.GetProvisionerJobByID(r.Context(),job.ID)
167171
iferr!=nil {
@@ -175,12 +179,6 @@ func (api *api) provisionerJobLogs(rw http.ResponseWriter, r *http.Request, job
175179
}
176180
}
177181

178-
functryFlush(w http.ResponseWriter) {
179-
ifflusher,ok:=w.(http.Flusher);ok {
180-
flusher.Flush()
181-
}
182-
}
183-
184182
func (api*api)provisionerJobResources(rw http.ResponseWriter,r*http.Request,job database.ProvisionerJob) {
185183
if!job.CompletedAt.Valid {
186184
httpapi.Write(rw,http.StatusPreconditionFailed, httpapi.Response{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp