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

Commit555a946

Browse files
committed
Add type for returning status code
1 parentd231994 commit555a946

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎agent/files.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
"github.com/coder/coder/v2/codersdk"
2020
)
2121

22+
typeHTTPResponseCode=int
23+
2224
func (a*agent)HandleReadFile(rw http.ResponseWriter,r*http.Request) {
2325
ctx:=r.Context()
2426

@@ -45,7 +47,7 @@ func (a *agent) HandleReadFile(rw http.ResponseWriter, r *http.Request) {
4547
}
4648
}
4749

48-
func (a*agent)streamFile(ctx context.Context,rw http.ResponseWriter,pathstring,offset,limitint64) (int,error) {
50+
func (a*agent)streamFile(ctx context.Context,rw http.ResponseWriter,pathstring,offset,limitint64) (HTTPResponseCode,error) {
4951
if!filepath.IsAbs(path) {
5052
returnhttp.StatusBadRequest,xerrors.Errorf("file path must be absolute: %q",path)
5153
}
@@ -125,7 +127,7 @@ func (a *agent) HandleWriteFile(rw http.ResponseWriter, r *http.Request) {
125127
})
126128
}
127129

128-
func (a*agent)writeFile(ctx context.Context,r*http.Request,pathstring) (int,error) {
130+
func (a*agent)writeFile(ctx context.Context,r*http.Request,pathstring) (HTTPResponseCode,error) {
129131
if!filepath.IsAbs(path) {
130132
returnhttp.StatusBadRequest,xerrors.Errorf("file path must be absolute: %q",path)
131133
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp