进行测试错误:导入路径包含反斜杠; 用斜线

I got the following output upon running test in my golang project (truncated. see the complete output down below) :

import path contains backslash; use slash: "gitlab.com\\group-name\\project-name/vendor/..."

project-name is the name of the project I'm working on. The project itself run smoothly, only the test was error.

I have no idea how such an import path (containing \\) generated, who could be responsible for generating that import (is it go test?), and how should I do about fixing it?

I tried to run the test after upgrading go version from 1.6.x to 1.8, if this matter.


environment :

  • go version go1.8 windows/amd64
  • goconvey v1.6.2
  • glide package manager

command :

go test api_test.go

output :

# command-line-arguments
.\api_test.go:6: import path contains backslash; use slash: "gitlab.com\\group-name\\project-name/vendor/github.com/smartystreets/assertions"
.\api_test.go:6: cannot import "gitlab.com\\group-name\\project-name/vendor/github.com/smartystreets/goconvey/convey" 
    due to version skew - reinstall package (bad package path "gitlab.com\\group-name\\project-name/vendor/github.com/smartystreets/assertions" for package assertions)
FAIL    command-line-arguments [build failed]

api_test.go : (just a random sample of goconvey for now, and still produce the error)

package test

import (
    "testing"

    . "github.com/smartystreets/goconvey/convey"
)

func TestIntegerStuff(t *testing.T) {
    Convey("Given some integer with a starting value", t, func() {
        x := 1

        Convey("When the integer is incremented", func() {
            x++

            Convey("The value should be greater by one", func() {
                So(x, ShouldEqual, 2)
            })
        })
    })
}