{"id":2401,"date":"2018-08-29T00:30:38","date_gmt":"2018-08-28T15:30:38","guid":{"rendered":"http:\/\/okamurax.com\/?p=2401"},"modified":"2020-05-06T00:18:16","modified_gmt":"2020-05-05T15:18:16","slug":"golang-%e3%83%a1%e3%83%a2","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=2401","title":{"rendered":"golang \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2"},"content":{"rendered":"<p>\u6700\u8fd1golang\u3092\u306f\u3058\u3081\u305f\u306e\u3067\u3002<\/p>\n<h2>WSL\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p><span style=\"color: #0000ff;\">sudo apt-get update<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo apt-get install golang<\/span><\/p>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d<br \/>\n<span style=\"color: #0000ff;\">go version<\/span><\/p>\n<p>&gt; 1.6.2<\/p>\n<p>\u74b0\u5883\u78ba\u8a8d<br \/>\n<span style=\"color: #0000ff;\">go env<\/span><\/p>\n<p>.bashrc\u306b\u8ffd\u52a0<br \/>\n<span style=\"color: #0000ff;\">export GOPATH=&#8221;$HOME\/go&#8221;<\/span><br \/>\n<span style=\"color: #0000ff;\">export PATH=&#8221;$GOPATH\/bin:$PATH&#8221;<\/span><\/p>\n<h2>Db(SQLite)\u3092\u4f7f\u3063\u3066\u307f\u308b<\/h2>\n<p><span style=\"color: #0000ff;\">go get github.com\/mattn\/go-sqlite3<\/span><\/p>\n<p><span style=\"font-size: 1rem;\">package context: unrecognized import path &#8220;context&#8221;<br \/>\n<\/span>\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u3067\u308b\u3002<\/p>\n<p>1.7\u3067\u306fcontext\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u3057\u3066\u6a19\u6e96\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u4ef2\u9593\u5165\u308a\u3059\u308b\u3002<br \/>\n\u3068\u306e\u3053\u3068\u306a\u306e\u3067\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8<\/p>\n<p><span style=\"color: #0000ff;\">sudo apt-get install golang-1.9<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo mv \/usr\/bin\/go \/usr\/bin\/go.old<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo mv \/usr\/bin\/gofmt \/usr\/bin\/gofmt.old<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo ln -s \/usr\/lib\/go-1.9\/bin\/go \/usr\/bin\/go<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo ln -s \/usr\/lib\/go-1.9\/bin\/gofmt \/usr\/bin\/gofmt<\/span><\/p>\n<p>\u3053\u308c\u3067\u5165\u3063\u305f\u3002<\/p>\n<h2>Windows\u7528\u306b\u30af\u30ed\u30b9\u30b3\u30f3\u30d1\u30a4\u30eb<\/h2>\n<p>WSL\u304b\u3089\u3060\u3068\u901a\u5e38\u3053\u3046\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001<br \/>\n<span style=\"color: #0000ff;\">GOOS=linux<br \/>\n<\/span>\u4ee5\u4e0b\u306e\u7528\u306b\u3057\u3066\u30d3\u30eb\u30c9<br \/>\n<span style=\"color: #0000ff;\">GOOS=windows go build hello.go<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1golang\u3092\u306f\u3058\u3081\u305f\u306e\u3067\u3002 WSL\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb sudo apt-get update sudo apt-get install golang \u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d go version &gt; 1.6.2 \u74b0\u5883\u78ba\u8a8d  &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=2401\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;golang \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[148],"class_list":["post-2401","post","type-post","status-publish","format-standard","hentry","category-1","tag-golang"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/2401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2401"}],"version-history":[{"count":2,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/2401\/revisions"}],"predecessor-version":[{"id":2407,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/2401\/revisions\/2407"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}