意圖
我打算完全匯入這個包(子目錄)以重用它的方法和型別:
https://github.com/hemantasapkota/go-convexhull/tree/master/convexhull
這是在這個存盤庫中:
https://github.com/hemantasapkota/go-convexhull
試過
我試圖匯入整個存盤庫:
import (
"github.com/hemantasapkota/go-convexhull"
)
但go get github.com/hemantasapkota/go-convexhull正在拋出錯誤。因為它的main.go檔案包含import "github.com/hemantasapkota/glu"哪個是私有存盤庫。
題
如何僅匯入convexhull該存盤庫的子目錄中的包?我的意思是,我不需要它main.go和它的麻煩。
當然,我可以將convexhull子目錄/包的檔案復制到我的專案中。但我正在尋找一種方法來簡單地從 GitHub匯入它。任何的想法?
uj5u.com熱心網友回復:
這有效:
import (
"github.com/hemantasapkota/go-convexhull/convexhull"
)
但是,在構建時,我收到了這個錯誤,我需要弄清楚:
Build Error: go test -c -o /tmp/__debug_bin930480706 -gcflags all=-N -l .
package printer/app/threed/detect/dental
imports github.com/hemantasapkota/go-convexhull/convexhull
imports github.com/go-gl/gl: build constraints exclude all Go files in /home/m3/go/pkg/mod/github.com/go-gl/gl@v0.0.0-20190320180904-bf2b1f2f34d7 (exit status 1)
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/362244.html
標籤:走
