编译postgres exporter遇到的问题该如何解决
发表于:2024-09-22 作者:千家信息网编辑
千家信息网最后更新 2024年09月22日,编译postgres exporter遇到的问题该如何解决,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。在编译prometheus的
千家信息网最后更新 2024年09月22日编译postgres exporter遇到的问题该如何解决
编译postgres exporter遇到的问题该如何解决,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。
在编译prometheus的postgres exporter时,遇到了以下错误:
[parallels@centos7 postgres_exporter]$ go run mage.go binarygo: finding github.com/magefile/mage v1.10.0go: downloading github.com/magefile/mage v1.10.0go: extracting github.com/magefile/mage v1.10.0Error determining list of magefiles: failed to list non-mage gofiles: exit status 1: go: cannot find main module, but found vendor/vendor.json in /home/parallels/Go/src/postgres_exporter to create a module there, run: go mod initexit status 1
经过调查,发现是之前配置的go mod环境变量导致的编译失败,具体原因还有待研究。
于是手工通过关闭GO111MODULE环境变量编译成功,如下:
[parallels@centos7 postgres_exporter]$ export GO111MODULE=off[parallels@centos7 postgres_exporter]$ go run mage.go binary2020/09/15 01:17:33 exec: git rev-parse --abbrev-ref HEAD2020/09/15 01:17:33 exec: git rev-parse HEAD2020/09/15 01:17:33 exec: git describe --dirty2020/09/15 01:17:33 exec: git describe --abbrev=02020/09/15 01:17:34 exec: go list ./...golang.org/x/tools/covergithub.com/pelletier/go-buffruneiogithub.com/google/shlexgithub.com/mattn/goverallsgithub.com/nicksnyder/go-i18n/i18n/languagegithub.com/alecthomas/unitsgithub.com/nicksnyder/go-i18n/i18n/translationgithub.com/pelletier/go-tomlgopkg.in/yaml.v2github.com/nicksnyder/go-i18n/i18n/bundlegithub.com/nicksnyder/go-i18n/i18nFinished 1 of 6gopkg.in/alecthomas/kingpin.v3-unstablegithub.com/alecthomas/gometalintergithub.com/kardianos/govendor/promptgolang.org/x/sys/unixgithub.com/dchest/safefilegithub.com/kardianos/govendor/internal/pathosgithub.com/Bowery/promptgithub.com/kardianos/govendor/internal/vosgithub.com/kardianos/govendor/clipromptgithub.com/kardianos/govendor/internal/vfilepathgithub.com/kardianos/govendor/pkgspecgithub.com/kardianos/govendor/vendorfilegithub.com/kardianos/govendor/vcsgithub.com/pkg/errorsgolang.org/x/tools/go/vcsFinished 2 of 6github.com/kardianos/govendor/contextgithub.com/wadey/gocovmergegithub.com/kardianos/govendor/migrateFinished 3 of 6github.com/kardianos/govendor/helpgithub.com/kardianos/govendor/rungithub.com/kardianos/govendorgithub.com/tmthrgd/go-bindata/internal/identifiergithub.com/tmthrgd/go-bindatagithub.com/tmthrgd/go-bindata/go-bindataFinished 4 of 6Finished 5 of 6github.com/nbutton23/zxcvbn-go/matchgolang.org/x/tools/go/ast/astutilgolang.org/x/tools/go/buildutilgolang.org/x/tools/go/loadergithub.com/nbutton23/zxcvbn-go/datagithub.com/GoASTScanner/gasgithub.com/nbutton23/zxcvbn-go/adjacencygithub.com/GoASTScanner/gas/outputgithub.com/nbutton23/zxcvbn-go/utils/mathgithub.com/nbutton23/zxcvbn-go/entropygithub.com/nbutton23/zxcvbn-go/frequencygithub.com/nbutton23/zxcvbn-go/scoringgithub.com/kisielk/gotoolgithub.com/nbutton23/zxcvbn-go/matchinggithub.com/ryanuber/go-globgithub.com/nbutton23/zxcvbn-gogithub.com/GoASTScanner/gas/rulesgithub.com/GoASTScanner/gas/cmd/gasFinished 6 of 6golang.org/x/tools/cmd/gotypegithub.com/opennota/check/cmd/structcheckFinished 1 of 25Finished 2 of 25github.com/alexflint/go-scalargithub.com/walle/lllgithub.com/alexflint/go-arggithub.com/walle/lll/cmd/lllhonnef.co/go/tools/deprecatedgolang.org/x/tools/go/types/typeutilhonnef.co/go/tools/versionhonnef.co/go/tools/ssaFinished 3 of 25honnef.co/go/tools/callgraphhonnef.co/go/tools/ssa/ssautilgolang.org/x/text/transformhonnef.co/go/tools/linthonnef.co/go/tools/lint/lintutilhonnef.co/go/tools/staticcheck/vrpgolang.org/x/text/widthhonnef.co/go/tools/internal/sharedcheckhonnef.co/go/tools/simplegithub.com/mdempsky/unconverthonnef.co/go/tools/callgraph/statichonnef.co/go/tools/unusedhonnef.co/go/tools/functionshonnef.co/go/tools/staticcheckhonnef.co/go/tools/cmd/megacheckFinished 4 of 25Finished 5 of 25github.com/jgautheron/goconstgithub.com/jgautheron/goconst/cmd/goconstFinished 6 of 25Finished 7 of 25honnef.co/go/tools/cmd/gosimplegolang.org/x/tools/go/ssamvdan.cc/lintgolang.org/x/tools/go/ssa/ssautilFinished 8 of 25mvdan.cc/interfacer/checkmvdan.cc/interfacergolang.org/x/tools/go/callgraphgolang.org/x/tools/go/callgraph/chagolang.org/x/tools/go/callgraph/rtamvdan.cc/unparam/checkmvdan.cc/unparamFinished 9 of 25github.com/opennota/check/cmd/varcheckFinished 10 of 25github.com/dnephin/govet/internal/whitelistgithub.com/dnephin/govet/internal/cfggithub.com/dnephin/govetFinished 11 of 25honnef.co/go/tools/cmd/unusedFinished 12 of 25Finished 13 of 25github.com/alecthomas/gocyclogolang.org/x/tools/importsFinished 14 of 25golang.org/x/tools/cmd/goimportsgithub.com/mdempsky/malignedFinished 15 of 25github.com/tsenart/deadcodeFinished 16 of 25github.com/mibk/dupl/suffixtreegithub.com/mibk/dupl/syntaxgithub.com/mibk/dupl/syntax/golanggithub.com/mibk/dupl/printerFinished 17 of 25github.com/mibk/dupl/jobgithub.com/mibk/duplgithub.com/client9/misspellFinished 18 of 25github.com/alexkohler/nakedretgithub.com/client9/misspell/cmd/misspellFinished 19 of 25golang.org/x/tools/container/intsetsgolang.org/x/tools/go/pointergithub.com/stripe/safesqlFinished 20 of 25golang.org/x/tools/go/gcimporter15golang.org/x/tools/go/gcexportdatagolang.org/x/lintFinished 21 of 25github.com/golang/lint/golintgithub.com/kisielk/errcheck/internal/errcheckgithub.com/kisielk/errcheckFinished 22 of 25github.com/gordonklaus/ineffassignFinished 23 of 25Finished 24 of 25honnef.co/go/tools/cmd/staticcheckFinished 25 of 25Building /home/parallels/Go/src/postgres_exporter/bin/postgres_exporter_v0.0.0_linux-amd64/postgres_exporter[parallels@centos7 postgres_exporter]$
关于编译postgres exporter遇到的问题该如何解决问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注行业资讯频道了解更多相关知识。
问题
编译
变量
更多
环境
帮助
解答
易行
成功
简单易行
内容
原因
小伙
小伙伴
手工
方法
知识
篇文章
行业
资讯
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
数据库技术市场增长率
被限制进入绿色服务器怎么办
禄劝方便软件开发市场报价
数据库构建的步骤
项目管理在软件开发中的重要性
网络安全国家奖学金
关于网络安全技术机制的书
安卓软件开发体会
ruby 服务器记录功能
兴达软件开发有限公司
安全风险清单数据库
戈伯特数据库
化工仿真软件开发
学习通数据库应用技术基础答案
体现网络安全
数据库连接检测
做软件开发工程师月薪
自学软件开发可靠吗
网络安全防护技能培训课程
报考清华网络安全研究生人数
路由器连接不上服务器zol问答
3g网络技术简称
pir蛋白质数据库入口
学哪个网络技术就业工资高
服务器安全访问远程桌面
滨湖区上门软件开发代理品牌
网络安全angliu
网站模版怎么上传服务器
网络安全防护技能培训课程
网络安全 七条底线