問題點
構建中缺少golang.org/x/image/font及golang.org/x/image/math/fixed源碼文件
../github.com/golang/freetype/truetype/face.go:13:2: cannot find package "golang.org/x/image/font" in any of: /root/go/src/golang.org/x/image/font (from $GOROOT) /root/gopath/src/golang.org/x/image/font (from $GOPATH) ../github.com/golang/freetype/raster/geom.go:12:2: cannot find package "golang.org/x/image/math/fixed" in any of: /root/go/src/golang.org/x/image/math/fixed (from $GOROOT) /root/gopath/src/golang.org/x/image/math/fixed (from $GOPATH)
解決辦法:
在此網站下載,所需文件
https://github.com/golang?page=1
下載方式:
首先在電腦上安裝git
yum -y install git
創建指定目錄:
mkdir -p golang.org/x
需要哪個,下載哪個即可
格式:git clone https://github.com/golang/xxx.git
git clone https://github.com/golang/image.git
或者下載到本地電腦上,然后上傳
下載完后,把所需要的文件,直接拷貝到指定目錄中,如果目錄不存在,需手動創建,例如:
下面這個無法連接,一頓折騰
https://github.com/MXi4oyu/golang.org