{"id":41678,"date":"2024-12-01T11:38:41","date_gmt":"2024-12-01T03:38:41","guid":{"rendered":"https:\/\/fwq.ai\/blog\/41678\/"},"modified":"2024-12-01T11:38:41","modified_gmt":"2024-12-01T03:38:41","slug":"goland%e6%98%be%e7%a4%baos-remove%e6%97%a0%e6%b3%95%e8%a7%a3%e6%9e%90%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/41678\/","title":{"rendered":"Goland\u663e\u793aos.Remove()\u65e0\u6cd5\u89e3\u6790\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<p>\u5f53\u524d\u4f4d\u7f6e\uff1a <span>&gt;<\/span>  <span>&gt;<\/span>  <span>&gt;<\/span>  <span>&gt;<\/span> <span>Goland\u663e\u793aos.Remove()\u65e0\u6cd5\u89e3\u6790\uff1f<\/span><\/p>\n<h1>Goland\u663e\u793aos.Remove()\u65e0\u6cd5\u89e3\u6790\uff1f<\/h1>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-21 08:09:37<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u5927\u5bb6\u597d\uff0c\u6211\u4eec\u53c8\u89c1\u9762\u4e86\u554a~\u672c\u6587<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aGoland\u663e\u793aos.Remove()\u65e0\u6cd5\u89e3\u6790\uff1f\u300b<\/span>\u7684\u5185\u5bb9\u4e2d\u5c06\u4f1a\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u3002\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">Golang<\/span>\u76f8\u5173\u77e5\u8bc6\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\uff0c\u4ee5\u540e\u4f1a\u7ed9\u5927\u5bb6\u5e26\u6765\u66f4\u591a<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">Golang<\/span>\u76f8\u5173\u6587\u7ae0\uff0c\u5e0c\u671b\u6211\u4eec\u80fd\u4e00\u8d77\u8fdb\u6b65\uff01\u4e0b\u9762\u5c31\u5f00\u59cb\u672c\u6587\u7684\u6b63\u5f0f\u5185\u5bb9~<\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u5728<code>goland<\/code> <em>(2022.1.3)<\/em>\u4e2d\uff0c\u4f7f\u7528<code>go<\/code> <em>(1.19.1)<\/em>\uff0c\u5b83\u65e0\u6cd5\u89e3\u6790<code>os.remove()<\/code>\uff0c\u4f46\u5982\u679c\u6211\u66f4\u6539\u4e3a<code>os.removeall()<\/code>\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u6211\u68c0\u67e5\u4e86go doc\u548c\u6e90\u4ee3\u7801\uff0c\u8be5\u51fd\u6570\u786e\u5b9e\u5b58\u5728\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u51fa\u4e86\u4ec0\u4e48\u95ee\u9898\uff1f\u8fd9\u662f goland bug \u5417\uff1f<\/p>\n<p><em>\uff08\u987a\u4fbf\u8bf4\u4e00\u53e5\uff0c\u6211\u6b63\u5728\u4f7f\u7528 linux \u64cd\u4f5c\u7cfb\u7edf\uff0c\u5982\u679c\u8fd9\u5f88\u91cd\u8981\u7684\u8bdd\u3002\uff09<\/em><\/p>\n<p><strong>\u5c4f\u5e55\u622a\u56fe<\/strong> <em>\uff08\u5728 goland\uff09<\/em>\uff1a<\/p>\n<p><strong>\u66f4\u65b0\uff1a<\/strong>\u53ef\u4ee5\u8fd0\u884c\u7684\u793a\u4f8b\u4ee3\u7801<\/p>\n<pre>package main\n\nimport (\n    \"os\"\n)\n\nfunc main() {\n    os.Create(\"\/tmp\/a.txt\")\n    os.Remove(\"\/tmp\/a.txt\")\n}<\/pre>\n<p>\u4ee3\u7801\u8fd0\u884c\u6ca1\u6709\u9519\u8bef\uff0c\u6240\u4ee5\u6211\u8ba4\u4e3a\u662fgoland\u7684bug\u3002<\/p>\n<p> <\/p>\n<h2>\u6b63\u786e\u7b54\u6848<\/h2>\n<p> <\/p>\n<p>Go \u5728 Go 1.19 \u4e2d\u5f15\u5165\u4e86\u65b0\u7684\u6784\u5efa\u6807\u7b7e <code>unix<\/code>\uff0c\u4f46\u4f4e\u4e8e 2022.2 \u7684 GoLand \u539f\u751f\u4e0d\u652f\u6301\u5b83\u3002<\/p>\n<ul>\n<li>\u5c06 GoLand \u66f4\u65b0\u81f3 2022.2.3\u3002<\/li>\n<li>\u6216\u8005\uff0c\u5728 Preferences\/Settings | \u6dfb\u52a0 <code>unix<\/code> \u6784\u5efa\u6807\u8bb0\u53bb |\u6784\u5efa\u6807\u7b7e\u548c\u4f9b\u5e94|\u81ea\u5b9a\u4e49\u6807\u7b7e\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u60a8\u5c06 IntelliJ \u4e0e Go \u63d2\u4ef6\u4e00\u8d77\u4f7f\u7528\uff0c\u8bf7\u786e\u4fdd\u5148\u5c06 IntelliJ \u5347\u7ea7\u5230 2022.2 \u6216\u66f4\u9ad8\u7248\u672c\u3002\u540c\u65f6\u4f1a\u63d0\u793a\u5347\u7ea7\u63d2\u4ef6\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\u7c73\u4e91\uff01\u66f4\u591a\u5173\u4e8eGolang\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u4f4d\u7f6e\uff1a &gt; &gt; &gt; &gt; Goland\u663e\u793aos.Remove()\u65e0\u6cd5\u89e3\u6790\uff1f Goland\u663e\u793aos.Remove()\u65e0\u6cd5\u89e3\u6790\uff1f \u6765\u6e90\uff1astackoverflow 2024-04-21 08:09:37 0\u6d4f\u89c8 \u6536\u85cf \u5927\u5bb6\u597d\uff0c\u6211\u4eec\u53c8\u89c1\u9762\u4e86\u554a~\u672c\u6587\u300aGoland\u663e\u793aos.Remove()\u65e0\u6cd5\u89e3\u6790\uff1f\u300b\u7684\u5185\u5bb9\u4e2d\u5c06\u4f1a\u6d89\u53ca\u5230\u7b49\u7b49\u3002\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60Golang\u76f8\u5173\u77e5\u8bc6\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\uff0c\u4ee5\u540e\u4f1a\u7ed9\u5927\u5bb6\u5e26\u6765\u66f4\u591aGolang\u76f8\u5173\u6587\u7ae0\uff0c\u5e0c\u671b\u6211\u4eec\u80fd\u4e00\u8d77\u8fdb\u6b65\uff01\u4e0b\u9762\u5c31\u5f00\u59cb\u672c\u6587\u7684\u6b63\u5f0f\u5185\u5bb9~ \u95ee\u9898\u5185\u5bb9 \u5728goland (2022.1.3)\u4e2d\uff0c\u4f7f\u7528go (1.19.1)\uff0c\u5b83\u65e0\u6cd5\u89e3\u6790os.remove()\uff0c\u4f46\u5982\u679c\u6211\u66f4\u6539\u4e3aos.removeall()\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002 \u6211\u68c0\u67e5\u4e86go doc\u548c\u6e90\u4ee3\u7801\uff0c\u8be5\u51fd\u6570\u786e\u5b9e\u5b58\u5728\u3002 \u6240\u4ee5\uff0c\u51fa\u4e86\u4ec0\u4e48\u95ee\u9898\uff1f\u8fd9\u662f goland bug \u5417\uff1f \uff08\u987a\u4fbf\u8bf4\u4e00\u53e5\uff0c\u6211\u6b63\u5728\u4f7f\u7528 linux \u64cd\u4f5c\u7cfb\u7edf\uff0c\u5982\u679c\u8fd9\u5f88\u91cd\u8981\u7684\u8bdd\u3002\uff09 \u5c4f\u5e55\u622a\u56fe \uff08\u5728 goland\uff09\uff1a \u66f4\u65b0\uff1a\u53ef\u4ee5\u8fd0\u884c\u7684\u793a\u4f8b\u4ee3\u7801 package main import ( &#8220;os&#8221; ) func main() { os.Create(&#8220;\/tmp\/a.txt&#8221;) os.Remove(&#8220;\/tmp\/a.txt&#8221;) } \u4ee3\u7801\u8fd0\u884c\u6ca1\u6709\u9519\u8bef\uff0c\u6240\u4ee5\u6211\u8ba4\u4e3a\u662fgoland\u7684bug\u3002 \u6b63\u786e\u7b54\u6848 Go \u5728 Go 1.19 \u4e2d\u5f15\u5165\u4e86\u65b0\u7684\u6784\u5efa\u6807\u7b7e unix\uff0c\u4f46\u4f4e\u4e8e 2022.2 \u7684 GoLand \u539f\u751f\u4e0d\u652f\u6301\u5b83\u3002 \u5c06 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-41678","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/41678","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=41678"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/41678\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=41678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=41678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=41678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}