【Go】解决“can't load package: no buildable Go source files in /...”

本文介绍了当遇到golang.org/x/net等外部包调用错误时的解决方法,包括检查编译环境一致性、使用go get获取及goinstall安装外部包的过程。对于无法科学上网的情况,提供了通过下载镜像文件并手动编译安装的步骤。

最近在调用golang.org/x/net出现这个错误。经检查后解决方法如下。在调用外部包时候出现这种情况,应检查以下设置


1.目标外部包的编译环境是否与当前工程的环境相同

2.先使用go get 获取外部包

   使用 go install 直接编译安装



关于本地未科学上网的情况下使用golang.org官方包的方法


1.到https://github.com/golang/找到对应的包的镜像文件

2.下载zip文件,解压后,修改文件目录为原始 golang.org目录

3.go install 编译安装


比如

golang.org/x/net

对应 github上的镜像地址是

https://github.com/golang/net

解析Config error in AncientHatch: impassable, player-buildable building that can be shot/seen over. UnityEngine.StackTraceUtility:ExtractStackTrace () Verse.Log:Error (string) Verse.DefDatabase`1<Verse.BuildableDef>:ErrorCheckAllDefs () System.Reflection.RuntimeMethodInfo:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) System.Reflection.MethodBase:Invoke (object,object[]) Verse.GenGeneric:InvokeStaticMethodOnGenericType (System.Type,System.Type,string) Verse.PlayDataLoader/<>c:<DoPlayLoad>b__4_1 (System.Type) System.Threading.Tasks.Parallel/<>c__DisplayClass33_0`2<System.Type, object>:<ForEachWorker>b__0 (int) System.Threading.Tasks.Parallel/<>c__DisplayClass19_0`1<object>:<ForWorker>b__1 (System.Threading.Tasks.RangeWorker&,int,bool&) System.Threading.Tasks.TaskReplicator/Replica`1<System.Threading.Tasks.RangeWorker>:ExecuteAction (bool&) System.Threading.Tasks.TaskReplicator/Replica:Execute () System.Threading.Tasks.TaskReplicator/Replica/<>c:<.ctor>b__4_0 (object) System.Threading.Tasks.Task:InnerInvoke () System.Threading.Tasks.Task:Execute () System.Threading.Tasks.Task:ExecutionContextCallback (object) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.Tasks.Task:ExecuteWithThreadLocal (System.Threading.Tasks.Task&) System.Threading.Tasks.Task:ExecuteEntry (bool) System.Threading.Tasks.Task:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () System.Threading.ThreadPoolWorkQueue:Dispatch () System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
最新发布
10-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值