解决go编译报错../github.com/golang/freetype/truetype/face.go:13:2: cannot find package "golang.org/x/image/font" in any of:
问题点
构建中缺少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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统