From adee4c9998a523e01c927fd1787de7618f23f2dd Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 12 Feb 2025 11:37:44 +0100 Subject: [PATCH] fix syntax_error in fake workspace --- libs/testserver/fake_workspace.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libs/testserver/fake_workspace.go b/libs/testserver/fake_workspace.go index d7c92515b..9d955d896 100644 --- a/libs/testserver/fake_workspace.go +++ b/libs/testserver/fake_workspace.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "net/http" + "path" "sort" "strconv" "strings" @@ -77,11 +77,11 @@ func (s *FakeWorkspace) WorkspaceDelete(path string, recursive bool) { } } -func (s *FakeWorkspace) WorkspaceFilesImportFile(path string, body []byte) { - if !strings.HasPrefix(path, "/") { - path = "/" + path +func (s *FakeWorkspace) WorkspaceFilesImportFile(p string, body []byte) { + if !strings.HasPrefix(p, "/") { + p = "/" + p } - s.files[path] = body + s.files[p] = body for { p = path.Dir(p) @@ -91,8 +91,6 @@ func (s *FakeWorkspace) WorkspaceFilesImportFile(path string, body []byte) { s.directories[p] = true } - - return "{}", http.StatusOK } func (s *FakeWorkspace) JobsCreate(request jobs.CreateJob) Response {