Golang出現的奇怪的問題

編譯時

C:\Go\pkg\tool\windows_amd64\link.exe: cannot open file C:\Go\pkg\windows_amd64/github.com/boltdb/bolt.a: open C:\Go\pkg\windows_amd64/github.com/boltdb/bolt.a: The system cannot find the file specified.

huanggang@DESKTOP-C1VUL6T MINGW64 /c/Program Files/StudyGo/src/mypublicchain/day02_03_Persistence (master)
$ go build main.go
# command-line-arguments
C:\Go\pkg\tool\windows_amd64\link.exe: cannot open file C:\Go\pkg\windows_amd64/github.com/boltdb/bolt.a: open C:\Go\pkg\windows_amd64/github.com/boltdb/bolt.a: The system cannot find the file specified.

使用 go build -i -v 進行檢查 發現是路徑出現錯誤

huanggang@DESKTOP-C1VUL6T MINGW64 /c/Program Files/StudyGo/src/mypublicchain/day02_03_Persistence (master)
$ go build -i -v
main.go:4:2: local import "./BLC" in non-local package

原先的路徑

import (

	"fmt"
	"./BLC"
)

修改後的路徑

import (

	"fmt"
	"mypublicchain/day02_03_Persistence/BLC"
)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章