{"id":207111,"date":"2025-07-08T09:07:52","date_gmt":"2025-07-08T01:07:52","guid":{"rendered":"https:\/\/server.hk\/cnblog\/207111\/"},"modified":"2025-07-08T09:07:52","modified_gmt":"2025-07-08T01:07:52","slug":"%e6%97%a0%e6%b3%95%e5%af%b9go%e8%af%ad%e8%a8%80%e9%a1%b9%e7%9b%ae%e8%bf%90%e8%a1%8ccoverity%e6%89%ab%e6%8f%8f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/207111\/","title":{"rendered":"\u65e0\u6cd5\u5bf9go\u8bed\u8a00\u9879\u76ee\u8fd0\u884ccoverity\u626b\u63cf"},"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>\u65e0\u6cd5\u5bf9go\u8bed\u8a00\u9879\u76ee\u8fd0\u884ccoverity\u626b\u63cf<\/span><\/p>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-20 08:57:39<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u201c\u7eb5\u6709\u75be\u98ce\u6765\uff0c\u4eba\u751f\u4e0d\u8a00\u5f03\u201d\uff0c\u8fd9\u53e5\u8bdd\u9001\u7ed9\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">Golang<\/span>\u7684\u670b\u53cb\u4eec\uff0c\u4e5f\u5e0c\u671b\u5728\u9605\u8bfb\u672c\u6587<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u65e0\u6cd5\u5bf9go\u8bed\u8a00\u9879\u76ee\u8fd0\u884ccoverity\u626b\u63cf\u300b<\/span>\u540e\uff0c\u80fd\u591f\u771f\u7684\u5e2e\u52a9\u5230\u5927\u5bb6\u3002\u6211\u4e5f\u4f1a\u5728\u540e\u7eed\u7684\u6587\u7ae0\u4e2d\uff0c\u9646\u7eed\u66f4\u65b0<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">Golang<\/span>\u76f8\u5173\u7684\u6280\u672f\u6587\u7ae0\uff0c\u6709\u597d\u7684\u5efa\u8bae\u6b22\u8fce\u5927\u5bb6\u5728\u8bc4\u8bba\u7559\u8a00\uff0c\u975e\u5e38\u611f\u8c22\uff01<\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u6211\u9009\u62e9\u5f00\u6e90\u6765\u8fd0\u884ccoverity\u626b\u63cf\u3002\u6211\u5c1d\u8bd5\u4e86\u4ee5\u4e0b\u65b9\u6cd5 &#8211;<\/p>\n<ol>\n<li>\n<p>\u4e0b\u8f7d\u9002\u7528\u4e8e linux 64 \u7684 coverity \u6784\u5efa\u5de5\u5177 (https:\/\/scan.coverity.com\/download\/other\/linux64)<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u7f6e\u8986\u76d6\u8def\u5f84<\/p>\n<\/li>\n<li>\n<p>\u5728coverity\u4e2d\u914d\u7f6ego\u6a21\u5757<\/p>\n<pre>cov-configure --template --compiler go --comptype go\n cov-configure --template --compiler go-module --comptype go-module<\/pre>\n<\/li>\n<li>\n<p>\u5c06\u5f00\u6e90\u5b58\u50a8\u5e93\u514b\u9686\u5230\u5355\u72ec\u7684\u6587\u4ef6\u5939\u4e2d<\/p>\n<\/li>\n<li>\n<p>\u73b0\u5728\u5c1d\u8bd5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c cov build<\/p>\n<pre>cov-build --config \/home\/vj202u\/coverityscan\/cov-analysis\/config\/coverity_config.xml --dir cov-int go build &lt;open_source_project_folder_path&gt;<\/pre>\n<\/li>\n<\/ol>\n<p>\u6536\u5230\u9519\u8bef &#8211;<\/p>\n<p> linux 5.4.0-67-generic x86_64 \u4e0a\u7684 coverity build capture\uff0864 \u4f4d\uff09\u7248\u672c 2020.09 \u5185\u90e8\u7248\u672c\u53f7\uff1a3412dc3383 p-upland-push-1502 <\/p>\n<p> [\u9519\u8bef] \u627e\u4e0d\u5230\u6784\u5efa\u547d\u4ee4\u3002 &#8216;.&#8217; <\/p>\n<p>\u6211\u4e5f\u5c1d\u8bd5\u7528\u5b83\u6765\u8fd0\u884c cov-build &#8211;<\/p>\n<pre>cov-build --dir cov-int --no-command --fs-capture-search .<\/pre>\n<p>\u5982\u679c\u6211\u9057\u6f0f\u4e86\u4ec0\u4e48\uff0c\u6709\u4eba\u53ef\u4ee5\u5efa\u8bae\u5417\uff1f\u6211\u6ca1\u6709\u627e\u5230\u4efb\u4f55\u8fd0\u884c\u5b83\u7684\u6587\u6863\uff0c\u5982\u679c\u6709\u7684\u8bdd\u8bf7\u53c2\u8003\u3002<\/p>\n<p> <\/p>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<p> <\/p>\n<p>\u8bf7\u8bbe\u7f6e PATH=$PATH:\/path\/to\/coverity\/bin\/folder<\/p>\n<p>\u4eca\u5929\u5173\u4e8e\u300a\u65e0\u6cd5\u5bf9go\u8bed\u8a00\u9879\u76ee\u8fd0\u884ccoverity\u626b\u63cf\u300b\u7684\u5185\u5bb9\u5c31\u4ecb\u7ecd\u5230\u8fd9\u91cc\u4e86\uff0c\u662f\u4e0d\u662f\u5b66\u8d77\u6765\u4e00\u76ee\u4e86\u7136\uff01\u60f3\u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u5185\u5bb9\u8bf7\u5173\u6ce8\u516c\u4f17\u53f7\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u4f4d\u7f6e\uff1a &gt; &gt; &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-207111","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/207111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=207111"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/207111\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=207111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=207111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=207111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}