{"id":362053,"date":"2021-02-23T16:43:37","date_gmt":"2021-02-23T08:43:37","guid":{"rendered":"http:\/\/4563.org\/?p=362053"},"modified":"2021-02-23T16:43:37","modified_gmt":"2021-02-23T08:43:37","slug":"golang%e7%9a%84%e5%bb%ba%e7%ab%8b%e7%ba%a6%e6%9d%9f%e6%80%8e%e4%b9%88%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=362053","title":{"rendered":"[Golang]\u7684\u5efa\u7acb\u7ea6\u675f\u600e\u4e48\u89e3\u51b3\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  [Golang]\u7684\u5efa\u7acb\u7ea6\u675f\u600e\u4e48\u89e3\u51b3\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : phpIsNumberOne <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u7528\u4e00\u4e2a\u9700\u6c42\uff0c\u4f7f\u7528 go \u5b9e\u73b0\u4e86\uff1b\u4f46\u662f\u662f\u5206\u7cfb\u7edf\u7684\uff0c\u51c6\u786e\u7684\u8bf4\u662f\u5206\u522b\u5199\u4e86\u4e2a Windows \u4e0b\u7684\u51fd\u6570\u548c\u975e Windows \u4e0b\u7684\u51fd\u6570\u3002\u5728 Windows \u7cfb\u7edf\u4e0b\u7684\u51fd\u6570\u5f15\u7528\u4e86\u5305<code>golang.org\/x\/sys\/windows<\/code>\u3002<\/p>\n<p>\u7136\u540e\u8c03\u7528\u7684\u65f6\u5019\u7c7b\u4f3c\u8fd9\u6837\uff1a<\/p>\n<pre><code>if runtime.GOOS == \"windows\"{     \/\/.... }else{    \/\/... }  <\/code><\/pre>\n<p>\u8fd0\u884c\u7684\u65f6\u5019\u5c31\u62a5\u4e86\u6784\u5efa\u7ea6\u675f\u7684\u9519\u8bef\uff0c\u96be\u9053\u5c31\u4e0d\u80fd\u628a\u4ed6\u4e24\u653e\u4e00\u8d77\u4e86\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>2<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5419794\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Evrins <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4ee5\u8fd9\u4e2a\u5305\u4e3a\u4f8b<br \/>github.com\/zach-klippenstein\/goadb<\/p>\n<p>executable.go<br \/>executable_unix.go<br \/>executable_win.go<\/p>\n<p>\/\/ +build windows<br \/>\/\/ +build darwin freebsd linux netbsd openbsd<\/p>\n<p>\u533a\u5206\u4e0d\u540c\u7cfb\u7edf\u7f16\u8bd1                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5419795\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : phpIsNumberOne <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Evrins \u975e\u5e38\u611f\u8c22\uff0c\u6211\u5df2\u7ecf\u5f7b\u5e95\u609f\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>[Golang]\u7684\u5efa\u7acb\u7ea6\u675f\u600e\u4e48\u89e3\u51b3&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/362053"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=362053"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/362053\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=362053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=362053"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=362053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}