Skip to content

Commit

Permalink
Use path.Join for expected package paths (#121)
Browse files Browse the repository at this point in the history
To fix unit test on windows and address #120
  • Loading branch information
craig65535 committed Nov 9, 2023
1 parent 94a7ac3 commit 7fb6390
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mockgen/mockgen_test.go
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"path"
"path/filepath"
"reflect"
"regexp"
Expand Down Expand Up @@ -369,7 +370,7 @@ func Test_createPackageMap(t *testing.T) {

func TestParsePackageImport_FallbackGoPath(t *testing.T) {
goPath := t.TempDir()
expectedPkgPath := filepath.Join("example.com", "foo")
expectedPkgPath := path.Join("example.com", "foo")
srcDir := filepath.Join(goPath, "src", expectedPkgPath)
err := os.MkdirAll(srcDir, 0o755)
if err != nil {
Expand All @@ -390,7 +391,7 @@ func TestParsePackageImport_FallbackMultiGoPath(t *testing.T) {
// first gopath
goPath := t.TempDir()
goPathList := []string{goPath}
expectedPkgPath := filepath.Join("example.com", "foo")
expectedPkgPath := path.Join("example.com", "foo")
srcDir := filepath.Join(goPath, "src", expectedPkgPath)
err := os.MkdirAll(srcDir, 0o755)
if err != nil {
Expand Down

0 comments on commit 7fb6390

Please sign in to comment.