In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to solve the problems encountered in compiling postgres exporter? in view of this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.
The following error was encountered while compiling postgres exporter for prometheus:
[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
After investigation, it is found that the compilation failure is caused by the previously configured go mod environment variables, but the specific reason remains to be studied.
So it was compiled manually by turning off the GO111MODULE environment variable, as follows:
[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] $answers on how to solve the problems encountered in compiling postgres exporter are shared here I hope the above content can help you to a certain extent, if you still have a lot of doubts to be solved, you can follow the industry information channel to learn more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.