工程中同时有两个main文件,编译的时候提示:

 go build proxy/proxy.go
pb/anti_spam.pb.go::: cannot find package "_/Users/xxx/go/src/git.company.com/aa/bb/vendor/github.com/golang/protobuf/proto" in any of:
/usr/local/Cellar/go/1.10./libexec/src/_/Users/xxx/go/src/git.company.com/aa/bb/vendor/github.com/golang/protobuf/proto (from $GOROOT)
/Users/xxx/go/src/_/Users/xxx/go/src/git.company.com/aa/bb/vendor/github.com/golang/protobuf/proto (from $GOPATH)

这个问题原因在于编译时候找不到包放在哪个位置,

然后系统和项目中不会有"_/Users/xxx" 这样的路径,那么主要问题就是文件导入路径引起的,

查看“proxy/proxy.go ”的源码发现如下引用:

gw "../pb"
由于该相对路径在make编译时候无法找到,将该路径换成 "git.corpautohome.com/gp_mb_ad_engine/pj"

这样的路径重新编译即可解决;

如果您认为本篇解决了问题可尽情打赏;

cost:2

参考:

https://github.com/Masterminds/glide/issues/602#issuecomment-327732992

golang-build-error的更多相关文章

  1. golang build error: syntax error: nested func not allowed

    在笔记本中写了一个简易web程序,但是编译失败,提示“syntax error: nested func not allowed” . 不明白什么意思,幸好代码量小,原来是方法的末尾的“}”丢了! p ...

  2. sublime text3 golang插件(golang build)

    1 前言 先前条件: sublime text3:下载地址:http://www.sublimetext.com/3 golang:下载地址:https://golang.google.cn/dl/ ...

  3. maven:log4j:WARN No appenders could be found for logger (loggerInfo).或者maven build error:org.apache.maven.lifecycle.LifecycleExecutionExceptio

    maven在build构建时,加载资源文件时需要配置资源文件插件: 1,在pom.xml文件中加入 <build> <finalName>${project.build.tar ...

  4. rpm build error: invalid predicate

    rpm build error error message:/usr/lib/rpm/find-debuginfo.sh /usr/src/redhat/BUILD/RPMS find: invali ...

  5. Build Error 6041: Internal build error

    Note: Following content is reprinted from the Original article Flexera : Build Error 6041. Only for ...

  6. 用VS不同版本打开项目,报错:MS Build Error MSB4019: Microsoft.WebApplication.targets was not found

    本例是在用VS2008打开项目是报错 未找到C:\Program Files\MSBuild\Microsoft\VisualStudio\V10.0 In the last article Buil ...

  7. installsheild2011打包程序internal build error 6213

    今天打包一个安装程序,总是出现报错,internal build error -6213,然后搜遍都没有找到什么解决方案.看到一个帖子,说是因为installsheild里面的build的时候自动扫描 ...

  8. 【转载】Android Gradle Build Error:Some file crunching failed, see logs for details解决办法

    Android Gradle Build Error:Some file crunching failed, see logs for details解决办法 转载请标明出处: http://www. ...

  9. golang开发:Error的使用

    Error是Go语言开发中最基础也是最重要的部分,跟其他语言的try catch的作用基本一致,想想在PHP JAVA开发中,try catch 不会使用,或者使用不灵活,就无法感知到程序运行中出现了 ...

  10. Android Gradle Build Error:Some file crunching failed, see logs for details解决办法

    转载请标明出处: http://www.cnblogs.com/why168888/p/5925756.html 本文出自:[Edwin博客园] 错误日志:Error:java.lang.Runtim ...

随机推荐

  1. oo作业总结(二)

    概述 和前三次作业相比,这几次作业最大的不同是难度的飞跃.遗憾的是在这难度的变化面前,我自己却没有做好充分的准备,错误的低估了作业难度导致给自己带来了很多不必要麻烦和损失.接下来我将对它们进行说明(度 ...

  2. IIS设置上传文件大小限制

    单位为字节. 500*1024*1024=524288000

  3. scanf *的用法

    scanf *的用法           char a[LEN]="12:13:14";     char i,j,k,h,l,m; sscanf(a,"%*c%*c:% ...

  4. 牛客第二场 J farm

    White Rabbit has a rectangular farmland of n*m. In each of the grid there is a kind of plant. The pl ...

  5. XGboost学习总结

    XGboost,全称Extrem Gradient boost,极度梯度提升,是陈天奇大牛在GBDT等传统Boosting算法的基础上重新优化形成的,是Kaggle竞赛的必杀神器. XGboost属于 ...

  6. Python基础4--一看就会的选择与循环

    1 选择 if elif else 注意后面均有: if age>18: print 'adult' elif age>6: print 'teenager' else: print 'k ...

  7. wx小程序修改swiper 点的样式

    <swiper class="swiper-box" indicator-dots="{{ indicatordots }}" autoplay=&quo ...

  8. FZU 2273 Triangles 第八届福建省赛 (三角形面积交 有重边算相交)

    Problem Description This is a simple problem. Given two triangles A and B, you should determine they ...

  9. HDU 2585 Hotel(字符串的模糊匹配+递归)

    Problem Description Last year summer Max traveled to California for his vacation. He had a great tim ...

  10. Spring Boot 揭秘与实战 源码分析 - 工作原理剖析

    文章目录 1. EnableAutoConfiguration 帮助我们做了什么 2. 配置参数类 – FreeMarkerProperties 3. 自动配置类 – FreeMarkerAutoCo ...