{"id":1501,"date":"2020-09-17T06:43:54","date_gmt":"2020-09-16T22:43:54","guid":{"rendered":"https:\/\/www.develop-note.com\/blog\/?p=1501"},"modified":"2022-02-16T22:00:22","modified_gmt":"2022-02-16T14:00:22","slug":"iris-go-install-2021ironman","status":"publish","type":"post","link":"https:\/\/www.develop-note.com\/blog\/2020\/09\/17\/iris-go-install-2021ironman\/","title":{"rendered":"Iris \u9019\u500b\u5728 go \u8a9e\u8a00\u4e0a\u5730\u8868\u6700\u5feb\u7684\u7db2\u9801\u6846\u67b6-\u5b89\u88dd go"},"content":{"rendered":"<h1>\u5b89\u88dd go<\/h1>\n<p>\u5b89\u88dd go \u662f\u4e00\u4ef6\u91cd\u8981\u7684\u5167\u5bb9\uff0c\u5728\u8aaa\u660e\u5b8c iris \u7cfb\u5217\u6587\u7ae0\u7684\u7de3\u7531\u4ee5\u53ca\u5927\u7db1\u4e4b\u5f8c\u63a5\u4e0b\u4f86\u8981\u9032\u5165\u6b63\u984c\u4e4b\u524d\u7576\u7136\u662f\u628a\u958b\u767c\u74b0\u5883\u7d66\u5efa\u7f6e\u597d\uff0c\u6240\u4ee5\u63a5\u4e0b\u4f86\u7684\u5167\u5bb9\u662f\u8981\u4ecb\u7d39\u5982\u4f55\u5728\u5404\u74b0\u5883\u4e2d\u5b89\u88dd go \u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u5b89\u88dd go \u7684\u65b9\u5f0f<\/h2>\n<p>\u76f8\u4fe1\u770b\u904e\u7b46\u8005\u4e4b\u524d\u5169\u7bc7\u7cfb\u5217\u6587 <a href=\"\/blog\/2018\/10\/02\/2019ironman-flask-restful-day01\/\" title=\"flask\">flask<\/a> \u53ca <a href=\"\/blog\/2019\/09\/03\/2020ironman-svelte-install\/\" title=\"svelte\">svelte<\/a> \u7684\u8b80\u8005\u5011\u90fd\u77e5\u9053\u7b46\u8005\u8981\u4f86\u4ecb\u7d39\u5982\u4f55\u5b89\u88dd\u7de8\u8b6f\u6240\u9700\u7684\u61c9\u7528\u7a0b\u5f0f\u3002\u5728\u9019\u500b go \u7684\u74b0\u5883\u7684\u5efa\u7f6e\u53ef\u4ee5\u5206\u6210\u4e09\u7a2e\u4f5c\u696d\u7cfb\u7d71\u3002<\/p>\n<h3>\u5b89\u88dd go \u5728Windows<\/h3>\n<p>\u5728Windows\u5b89\u88dd go\u7684\u7de8\u8b6f\u7a0b\u5f0f\u6bd4\u5b89\u88dd [python] \u5bb9\u6613\u591a\u4e86\uff0c\u9019\u908a\u6709\u5169\u7a2e\u5b89\u88dd\u65b9\u5f0f\uff0c\u7b2c\u4e00\u7a2e\u662f\u76f4\u63a5\u5230 [go\u7684\u4e0b\u8f09\u7db2\u9801] \u4e0b\u8f09\u3002\u53e6\u500b\u65b9\u6cd5\u66f4\u7c21\u55ae\u5c31\u662f\u5148\u5b89\u88dd<a href=\"https:\/\/chocolatey.org\/packages\/golang\" title=\"chocolate go\" rel=\"nofollow noopener\" target=\"_blank\">chocolate<\/a> \u7136\u5f8c\u8f38\u5165\u4ee5\u4e0b\u6307\u4ee4\u5373\u53ef\u3002<\/p>\n<pre><code class=\"language-bash\">choco install golang<\/code><\/pre>\n<h3>\u5b89\u88dd go \u5728 macOS<\/h3>\n<p>\u5728macOS\u7684\u74b0\u5883\u4e2d\u5c31\u5982\u540c [python] \u7684\u5b89\u88dd\u65b9\u5f0f\uff0c\u9996\u5148\u5148\u5b89\u88dd <a href=\"https:\/\/brew.sh\/\" title=\"homebrew\" rel=\"nofollow noopener\" target=\"_blank\">homebrew<\/a> \u9019\u5de5\u5177\uff0c\u63a5\u4e0b\u4f86\u8f38\u5165\u4e0b\u5217\u6307\u4ee4\u5373\u53ef\u3002<\/p>\n<pre><code class=\"language-bash\">brew install go<\/code><\/pre>\n<h3>\u5b89\u88dd go \u5728 Linux<\/h3>\n<p>\u5728Linux\u5c31\u6c92\u53c8\u90a3\u9ebc\u7c21\u55ae\u4e86\uff0c\u6240\u4ee5\u5148\u5206\u6210\u5e7e\u500b\u6b65\u9a5f\u4f86\u57f7\u884c\uff0c\u9996\u5148\u662f\u5f9e\u5b98\u7db2\u4e0b\u8f09\u58d3\u7e2e\u6a94\u3002<\/p>\n<pre><code class=\"language-bash\">wget https:\/\/dl.google.com\/go\/go1.15.linux-amd64.tar.gz<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\u662f\u89e3\u58d3\u7e2e\u525b\u525b\u4e0b\u8f09\u7684\u58d3\u7e2e\u6a94<\/p>\n<pre><code class=\"language-bash\">sudo tar -xvf go1.15.linux-amd64.tar.gz\nsudo mv go \/usr\/local<\/code><\/pre>\n<p>\u6700\u5f8c\u662f\u8a2d\u5b9a\u74b0\u5883\u8b8a\u6578\uff0c\u5728~\/.profile\u52a0\u5165\u4ee5\u4e0b\u5167\u5bb9<\/p>\n<pre><code class=\"language-bash\">export PATH=$PATH:\/usr\/local\/go\/bin<\/code><\/pre>\n<h2>\u78ba\u8a8d\u74b0\u5883<\/h2>\n<p>\u5728\u5b89\u88dd\u5b8c\u4e4b\u5f8c\u600e\u9ebc\u77e5\u9053\u74b0\u5883\u8a2d\u5b9a\u6b63\u5e38\u5462\uff1f\u9996\u5148\u5148\u65b0\u589e\u4e00\u500b main.go \u7684\u6a94\u6848\uff0c\u4e26\u4e14\u8f38\u5165\u4ee5\u4e0b\u5167\u5bb9<\/p>\n<pre><code class=\"language-go\">package main\n\nimport &quot;fmt&quot;\n\nfunc main() {\n    fmt.Println(&quot;Hello, world&quot;)\n}<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\u5728\u547d\u4ee4\u5217\u8f38\u5165\u4ee5\u4e0b\u5167\u5bb9<\/p>\n<pre><code class=\"language-bash\">go run main.go<\/code><\/pre>\n<p>\u76f8\u4fe1\u5404\u4f4d\u89c0\u773e\u53ef\u4ee5\u770b\u5230\u7d50\u679c\u4e86<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u5728\u9019\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u4ecb\u7d39\u8981\u5982\u4f55\u8a2d\u5b9a\u7de8\u5beb go \u8a9e\u8a00\u7684\u74b0\u5883\uff0c\u5728\u5b89\u88dd\u5b8c\u6240\u9700\u7a0b\u5f0f\u5f8c\u5c31\u53ef\u4ee5\u958b\u59cb\u958b\u767c\u4e86\u3002\u63a5\u4e0b\u4f86\u4e0b\u7bc7\u8981\u6e96\u5099\u958b\u59cb\u4ecb\u7d39 go \u7684\u8a9e\u6cd5\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88dd go \u5b89\u88dd go \u662f\u4e00\u4ef6\u91cd\u8981\u7684\u5167\u5bb9\uff0c\u5728\u8aaa\u660e\u5b8c iris \u7cfb\u5217\u6587\u7ae0\u7684\u7de3\u7531\u4ee5\u53ca\u5927\u7db1\u4e4b\u5f8c\u63a5\u4e0b\u4f86\u8981\u9032\u5165\u6b63\u984c\u4e4b\u524d\u7576 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.develop-note.com\/blog\/2020\/09\/17\/iris-go-install-2021ironman\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008Iris \u9019\u500b\u5728 go \u8a9e\u8a00\u4e0a\u5730\u8868\u6700\u5feb\u7684\u7db2\u9801\u6846\u67b6-\u5b89\u88dd go\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[158,81],"class_list":["post-1501","post","type-post","status-publish","format-standard","hentry","category-develop","tag-2020ironman","tag-go"],"_links":{"self":[{"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/posts\/1501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/comments?post=1501"}],"version-history":[{"count":6,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/posts\/1501\/revisions"}],"predecessor-version":[{"id":2691,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/posts\/1501\/revisions\/2691"}],"wp:attachment":[{"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/media?parent=1501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/categories?post=1501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/tags?post=1501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}