From 44ec93275dda56356a7039c0a54abbb13804973b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 10 Jul 2023 10:58:14 +0200 Subject: [PATCH] Cleanup: reformat all Go files Run `go fmt` on all files, to fix their formatting. No functional changes. --- internal/worker/command_exe.go | 2 +- internal/worker/command_file_mgmt.go | 1 - internal/worker/command_file_mgmt_test.go | 6 ++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/worker/command_exe.go b/internal/worker/command_exe.go index e906b453..8af8fa17 100644 --- a/internal/worker/command_exe.go +++ b/internal/worker/command_exe.go @@ -90,7 +90,7 @@ func NewCommandExecutor(cli CommandLineRunner, listener CommandListener, timeSer // file-management "move-directory": ce.cmdMoveDirectory, - "copy-file": ce.cmdCopyFile, + "copy-file": ce.cmdCopyFile, } return ce diff --git a/internal/worker/command_file_mgmt.go b/internal/worker/command_file_mgmt.go index e1e60c91..1dc285aa 100644 --- a/internal/worker/command_file_mgmt.go +++ b/internal/worker/command_file_mgmt.go @@ -215,7 +215,6 @@ func fileCopy(src, dest string) (error, string) { return nil, msg } - func fileExists(filename string) bool { _, err := os.Stat(filename) return !errors.Is(err, fs.ErrNotExist) diff --git a/internal/worker/command_file_mgmt_test.go b/internal/worker/command_file_mgmt_test.go index 4c68baa9..76170ea8 100644 --- a/internal/worker/command_file_mgmt_test.go +++ b/internal/worker/command_file_mgmt_test.go @@ -345,7 +345,6 @@ func TestCmdCopyFileDestinationExists(t *testing.T) { assert.Error(t, f.run()) } - func TestCmdCopyFileSourceIsDir(t *testing.T) { f := newCmdCopyFileFixture(t) defer f.finish(t) @@ -372,7 +371,6 @@ func TestCmdCopyFileSourceIsDir(t *testing.T) { assert.Error(t, f.run()) } - func newCmdCopyFileFixture(t *testing.T) cmdCopyFileFixture { mockCtrl := gomock.NewController(t) ce, mocks := testCommandExecutor(t, mockCtrl) @@ -410,11 +408,11 @@ func (f cmdCopyFileFixture) finish(t *testing.T) { f.mockCtrl.Finish() } -func (f cmdCopyFileFixture) run() error { +func (f cmdCopyFileFixture) run() error { cmd := api.Command{ Name: "copy-file", Parameters: map[string]interface{}{ - "src": f.absolute_src_path, + "src": f.absolute_src_path, "dest": f.absolute_dest_path, }, }