{"id":36464,"date":"2024-11-26T16:32:39","date_gmt":"2024-11-26T08:32:39","guid":{"rendered":"https:\/\/fwq.ai\/blog\/36464\/"},"modified":"2024-11-26T16:32:39","modified_gmt":"2024-11-26T08:32:39","slug":"%e5%9c%a8linux-%e5%91%bd%e4%bb%a4%e8%a1%8c%e4%b8%8b%e6%b5%8f%e8%a7%88%e5%a4%a9%e6%b0%94%e9%a2%84%e6%8a%a5","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/36464\/","title":{"rendered":"\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/887\/227\/172684082018066.jpg\" class=\"aligncenter\" title=\"\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5\u63d2\u56fe\" alt=\"\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5\u63d2\u56fe\" \/><\/p>\n<p>\u5728 \u4e0b\u5b89\u88c5 wego<\/p>\n<p>\u5b89\u88c5 wego \u76f8\u5f53\u7b80\u5355\u3002wego \u662f\u7528 Go \u7f16\u5199\u7684\uff0c\u5f15\u8d77\u7b2c\u4e00\u4e2a\u6b65\u9aa4\u5c31\u662f\u5b89\u88c5Go \u8bed\u8a00\u3002\u7136\u540e\u518d\u5b89\u88c5 wego\u3002<\/p>\n<pre>$ go get github.com\/schachmat\/wego<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>wego \u4f1a\u88ab\u5b89\u88c5\u5230 $GOPATH\/bin\uff0c\u6240\u4ee5\u8981\u5c06 $GOPATH\/bin \u6dfb\u52a0\u5230 $PATH \u73af\u5883\u53d8\u91cf\u3002<\/p>\n<pre>$ echo'export PATH=\"$PATH:$GOPATH\/bin\"'&gt;&gt;~\/.bashrc\n\n$ source ~\/.bashrc<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u73b0\u5728\u5c31\u53ef\u4e0e\u76f4\u63a5\u4ece\u547d\u4ee4\u884c\u542f\u52a8 wego \u4e86\u3002<\/p>\n<pre>$ wego<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7b2c\u4e00\u6b21\u8fd0\u884c weg \u4f1a\u751f\u6210\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6(~\/.wegorc)\uff0c\u4f60\u9700\u8981\u6307\u5b9a\u4e00\u4e2a\u5929\u6c14 API key\u3002 \u4f60\u53ef\u4ee5\u4ece worldweatheronline.com \u83b7\u53d6\u4e00\u4e2a\u514d\u8d39\u7684 API key\u3002\u514d\u8d39\u6ce8\u518c\u548c\u4f7f\u7528\u3002\u4f60\u53ea\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a\u6709\u6548\u7684\u90ae\u7bb1\u5730\u5740\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/887\/227\/172684082017442.jpg\" class=\"aligncenter\" title=\"\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5\u63d2\u56fe1\" alt=\"\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5\u63d2\u56fe1\" \/><\/p>\n<p>\u3000\u3000\u4f60\u7684 .wegorc \u914d\u7f6e\u6587\u4ef6\u770b\u8d77\u6765\u4f1a\u8fd9\u6837\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/887\/227\/172684082069610.jpg\" class=\"aligncenter\" title=\"\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5\u63d2\u56fe2\" alt=\"\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5\u63d2\u56fe2\" \/><\/p>\n<p>\u3000\u3000\u9664\u4e86 API key\uff0c\u4f60\u8fd8\u53ef\u4ee5\u628a\u4f60\u60f3\u8981\u67e5\u8be2\u5929\u6c14\u7684\u5730\u65b9\u3001\u4f7f\u7528\u7684\u57ce\u5e02\/\u56fd\u5bb6\u540d\u79f0\u3001\u8bed\u8a00\u914d\u7f6e\u5728 ~\/.wegorc \u4e2d\u3002 \u6ce8\u610f\uff0c\u8fd9\u4e2a\u5929\u6c14 API \u7684\u4f7f\u7528\u6709\u9650\u5236\uff1a\u6bcf\u79d2\u6700\u591a 5 \u6b21\u67e5\u8be2\uff0c\u6bcf\u5929\u6700\u591a 250 \u6b21\u67e5\u8be2\u3002 \u5f53\u4f60\u91cd\u65b0\u6267\u884c wego \u547d\u4ee4\uff0c\u4f60\u5c06\u4f1a\u770b\u5230\u6700\u65b0\u7684\u5929\u6c14\u9884\u62a5(\u5f53\u7136\u662f\u4f60\u7684\u6307\u5b9a\u5730\u65b9)\uff0c\u5982\u9898\u56fe\u663e\u793a\u3002<\/p>\n<p>\u663e\u793a\u51fa\u6765\u7684\u5929\u6c14\u4fe1\u606f\u5305\u62ec\uff1a(1)\u6e29\u5ea6\uff0c(2)\u98ce\u901f\u548c\u98ce\u5411\uff0c(3)\u53ef\u89c6\u8ddd\u79bb\uff0c(4)\u964d\u6c34\u91cf\u548c\u964d\u6c34\u6982\u7387 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4f1a\u663e\u793a3 \u5929\u7684\u5929\u6c14\u9884\u62a5\u3002\u5982\u679c\u8981\u8fdb\u884c\u4fee\u6539\uff0c\u53ef\u4ee5\u901a\u8fc7\u53c2\u6570\u6539\u53d8\u5929\u6c14\u8303\u56f4(\u6700\u591a5\u5929)\uff0c\u6bd4\u5982\u8981\u67e5\u770b5 \u5929\u7684\u5929\u6c14\u9884\u62a5\uff1a<\/p>\n<pre>$ wego 5<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c\u4f60\u60f3\u68c0\u67e5\u53e6\u4e00\u4e2a\u5730\u65b9\u7684\u5929\u6c14\uff0c\u53ea\u9700\u8981\u63d0\u4f9b\u57ce\u5e02\u540d\u5373\u53ef\uff1a<\/p>\n<pre>$ wego Seattle<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u95ee\u9898\u89e3\u51b3<\/p>\n<p>\u53ef\u80fd\u4f1a\u9047\u5230\u4e0b\u9762\u7684\u9519\u8bef\uff1a<br \/><span style=\"padding: 4px 8px;font-size: 12px;border-radius: 3px;color: #c7254e;background-color: #f9f2f4\">user:Currentnot implemented on linux\/amd64<\/span><\/p>\n<p>\u5f53\u4f60\u5728\u4e00\u4e2a\u4e0d\u652f\u6301\u539f\u751f Go \u7f16\u8bd1\u5668\u7684\u73af\u5883\u4e0b\u8fd0\u884c wego \u65f6\u5c31\u4f1a\u51fa\u73b0\u8fd9\u4e2a\u9519\u8bef\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u4f60\u53ea\u9700\u8981\u4f7f\u7528 gccgo \u2014\u2014\u4e00\u4e2a Go \u7684\u7f16\u8bd1\u5668\u524d\u7aef\u6765\u7f16\u8bd1\u7a0b\u5e8f\u5373\u53ef\u3002\u8fd9\u4e00\u6b65\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u5b8c\u6210\u3002<\/p>\n<pre>$ sudoyum install gcc-go\n\n$ go get-compiler=gccgo github.com\/schachmat\/wego<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5\u7684\u65b9\u6cd5\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 \u4e0b\u5b89\u88c5 wego \u5b89\u88c5 wego \u76f8\u5f53\u7b80\u5355\u3002wego \u662f\u7528 Go \u7f16\u5199\u7684\uff0c\u5f15\u8d77\u7b2c\u4e00\u4e2a\u6b65\u9aa4\u5c31\u662f\u5b89\u88c5Go \u8bed\u8a00\u3002\u7136\u540e\u518d\u5b89\u88c5 wego\u3002 $ go get github.com\/schachmat\/wego \u767b\u5f55\u540e\u590d\u5236 wego \u4f1a\u88ab\u5b89\u88c5\u5230 $GOPATH\/bin\uff0c\u6240\u4ee5\u8981\u5c06 $GOPATH\/bin \u6dfb\u52a0\u5230 $PATH \u73af\u5883\u53d8\u91cf\u3002 $ echo&#8217;export PATH=&#8221;$PATH:$GOPATH\/bin&#8221;&#8216;&gt;&gt;~\/.bashrc $ source ~\/.bashrc \u767b\u5f55\u540e\u590d\u5236 \u73b0\u5728\u5c31\u53ef\u4e0e\u76f4\u63a5\u4ece\u547d\u4ee4\u884c\u542f\u52a8 wego \u4e86\u3002 $ wego \u767b\u5f55\u540e\u590d\u5236 \u7b2c\u4e00\u6b21\u8fd0\u884c weg \u4f1a\u751f\u6210\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6(~\/.wegorc)\uff0c\u4f60\u9700\u8981\u6307\u5b9a\u4e00\u4e2a\u5929\u6c14 API key\u3002 \u4f60\u53ef\u4ee5\u4ece worldweatheronline.com \u83b7\u53d6\u4e00\u4e2a\u514d\u8d39\u7684 API key\u3002\u514d\u8d39\u6ce8\u518c\u548c\u4f7f\u7528\u3002\u4f60\u53ea\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a\u6709\u6548\u7684\u90ae\u7bb1\u5730\u5740\u3002 \u3000\u3000\u4f60\u7684 .wegorc \u914d\u7f6e\u6587\u4ef6\u770b\u8d77\u6765\u4f1a\u8fd9\u6837\uff1a \u3000\u3000\u9664\u4e86 API key\uff0c\u4f60\u8fd8\u53ef\u4ee5\u628a\u4f60\u60f3\u8981\u67e5\u8be2\u5929\u6c14\u7684\u5730\u65b9\u3001\u4f7f\u7528\u7684\u57ce\u5e02\/\u56fd\u5bb6\u540d\u79f0\u3001\u8bed\u8a00\u914d\u7f6e\u5728 ~\/.wegorc \u4e2d\u3002 \u6ce8\u610f\uff0c\u8fd9\u4e2a\u5929\u6c14 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-36464","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/36464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=36464"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/36464\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=36464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=36464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=36464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}