diff --git a/pkg/cmd/gist/create/create.go b/pkg/cmd/gist/create/create.go index 5bb2bb2a3..4c15e9b17 100644 --- a/pkg/cmd/gist/create/create.go +++ b/pkg/cmd/gist/create/create.go @@ -8,7 +8,7 @@ import ( "io" "io/ioutil" "net/http" - "path" + "path/filepath" "regexp" "sort" "strings" @@ -215,7 +215,7 @@ func processFiles(stdin io.ReadCloser, filenameOverride string, filenames []stri return fs, fmt.Errorf("failed to read file %s: %w", f, err) } - filename = path.Base(f) + filename = filepath.Base(f) } fs[filename] = &shared.GistFile{ diff --git a/pkg/cmd/gist/create/create_test.go b/pkg/cmd/gist/create/create_test.go index 450e20f99..d62566e98 100644 --- a/pkg/cmd/gist/create/create_test.go +++ b/pkg/cmd/gist/create/create_test.go @@ -5,7 +5,7 @@ import ( "encoding/json" "io/ioutil" "net/http" - "path" + "path/filepath" "strings" "testing" @@ -163,9 +163,9 @@ func TestNewCmdCreate(t *testing.T) { func Test_createRun(t *testing.T) { tempDir := t.TempDir() - fixtureFile := path.Join(tempDir, "fixture.txt") + fixtureFile := filepath.Join(tempDir, "fixture.txt") assert.NoError(t, ioutil.WriteFile(fixtureFile, []byte("{}"), 0644)) - emptyFile := path.Join(tempDir, "empty.txt") + emptyFile := filepath.Join(tempDir, "empty.txt") assert.NoError(t, ioutil.WriteFile(emptyFile, []byte(" \t\n"), 0644)) tests := []struct {