{"id":785,"date":"2021-11-29T10:49:07","date_gmt":"2021-11-29T01:49:07","guid":{"rendered":"https:\/\/blog.wsd.sh\/?p=785"},"modified":"2021-12-22T07:53:28","modified_gmt":"2021-12-21T22:53:28","slug":"no-required-module-provides-package-github-com-go-sql-driver-mysql-go-mod-file-not-found-in-current-directory-or-any-parent-directory-see-go-help-modules","status":"publish","type":"post","link":"https:\/\/blog.wsd.sh\/?p=785","title":{"rendered":"<small>no required module provides package github.com\/go-sql-driver\/mysql: go.mod file not found in current directory or any parent directory; see \u2018go help modules\u2019<\/small>"},"content":{"rendered":"<p>\u74b0\u5883: CentOS8<br \/>\n#dnf update -y\u306e\u5f8c\u306b\u3001\u4e0a\u8a18\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002<br \/>\n\u89e3\u6c7a\u65b9\u6cd5: \u4ee5\u4e0b\u3092\u5b9f\u884c<br \/>\n# go env -w GO111MODULE=auto<\/p>\n<pre>\r\n# go build -o a.out main.go\r\nmain.go:6:3: no required module provides package github.com\/go-sql-driver\/mysql: go.mod file not found in current directory or any parent directory; see 'go help modules'\r\nsrc\/mariadb_1-7.go:17:2: cannot find package\r\n# ls\r\na.out  errlog  lib  main.go  src\r\n# go env -w GO111MODULE=auto\r\n# go build -o a.out main.go\r\n#\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u74b0\u5883: CentOS8 #dnf update -y\u306e\u5f8c\u306b\u3001\u4e0a\u8a18\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002 \u89e3\u6c7a\u65b9\u6cd5: \u4ee5\u4e0b\u3092\u5b9f\u884c # go env -w GO111MODULE=auto # go build -o a.out m&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/785"}],"collection":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=785"}],"version-history":[{"count":6,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/785\/revisions"}],"predecessor-version":[{"id":821,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/785\/revisions\/821"}],"wp:attachment":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}