After reading about go list I made a small powershell script that will list all dependencies of a project, but also query the Github API for license information for all github imported packages

blov · · 447 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p><a href="https://gist.github.com/elvarb/c680e52b83f069cc5e4cd2e8033999d3">https://gist.github.com/elvarb/c680e52b83f069cc5e4cd2e8033999d3</a></p> <p>Because the API has a rate limit it is better to generate an API key for this.</p> <p><a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a></p> <p>Example output</p> <pre><code>encoding/hex encoding/json encoding/pem errors flag fmt github.com/BurntSushi/toml -&gt; License: MIT License github.com/fsnotify/fsnotify -&gt; License: BSD 3-clause &#34;New&#34; or &#34;Revised&#34; License github.com/hashicorp/hcl -&gt; License: Mozilla Public License 2.0 </code></pre> <p>This really should be a go program or a feature in go list.</p> <hr/>**评论:**<br/><br/>ChristophBerger: <pre><p>Nice! </p> <p>The next iteration could be a re-write in Go (= cross-platform)... (Or does someone have a powershell-to-fish converter around?)</p></pre>noonexx: <pre><p>The newest PowerShell is cross-platform and afaik open source. The script above works just as well on my Linux installation.</p></pre>ChristophBerger: <pre><p>Wow, didn&#39;t know that. But it <a href="https://github.com/PowerShell/PowerShell">appears to be true</a>...</p> <p>Guess I&#39;ll have to check this out...</p></pre>Redundancy_: <pre><p>I think the question is why anyone would want to read or write powershell by choice. I&#39;ve provisioned machines with it, but I really hate using it due to the way that it&#39;s more a shell script than a programming language (in error handling and string manipulation etc)</p></pre>slantview: <pre><p>Honestly, being written for go but using powershell is just kinda head scratching.</p></pre>DudPug: <pre><p>It was just something I needed to do quickly and I&#39;m still more proficient in powershell than in go.</p> <p>Should be very easy to do in go though and might be something I do in the future. </p></pre>anxiousalpaca: <pre><p>sweet</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

447 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传