Skip to content

Commit 7fb6390

Browse files
authored
Use path.Join for expected package paths (#121)
To fix unit test on windows and address #120
1 parent 94a7ac3 commit 7fb6390

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mockgen/mockgen_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"fmt"
55
"os"
6+
"path"
67
"path/filepath"
78
"reflect"
89
"regexp"
@@ -369,7 +370,7 @@ func Test_createPackageMap(t *testing.T) {
369370

370371
func TestParsePackageImport_FallbackGoPath(t *testing.T) {
371372
goPath := t.TempDir()
372-
expectedPkgPath := filepath.Join("example.com", "foo")
373+
expectedPkgPath := path.Join("example.com", "foo")
373374
srcDir := filepath.Join(goPath, "src", expectedPkgPath)
374375
err := os.MkdirAll(srcDir, 0o755)
375376
if err != nil {
@@ -390,7 +391,7 @@ func TestParsePackageImport_FallbackMultiGoPath(t *testing.T) {
390391
// first gopath
391392
goPath := t.TempDir()
392393
goPathList := []string{goPath}
393-
expectedPkgPath := filepath.Join("example.com", "foo")
394+
expectedPkgPath := path.Join("example.com", "foo")
394395
srcDir := filepath.Join(goPath, "src", expectedPkgPath)
395396
err := os.MkdirAll(srcDir, 0o755)
396397
if err != nil {

0 commit comments

Comments
 (0)