如何查看go依赖包的license (glice)

Reference: https://github.com/ribice/glice

Installation:

Download and install glice by executing:

go install github.com/ribice/glice/v2/cmd/glice@latest

To update:

go get -u github.com/ribice/glice/v2

Usage:

To run glice, navigate to a folder with go.mod and execute:

glice

Alternatively, you can provide path which you want to be scanned with -p flag:

glice -p "github.com/ribice/glice"

By default glice:

Prints to stdout

Gets dependencies from go.mod

Fetches licenses for dependencies hosted on GitHub

Is limited to 60 API calls on GitHub (up to 60 dependencies from github.com). API key can be provided by setting GITHUB_API_KEY environment variable.

All flags are optional. Glice supports the following flags:

- f [boolean, fileWrite] // Writes all licenses to /licenses dir
- i [boolean, indirect] // Parses indirect dependencies as well
- p [string - path] // Path to be scanned in form of github.com/author/repo
- t [boolean - thanks] // if GitHub API key is provided, setting this flag will star all GitHub repos from dependency. __In order to do this, API key must have access to public_repo__
- v (boolean - verbose) // If enabled, will log dependencies before fetching and printing them.
- fmt (string - format) // Format of the output. Defaults to table, other available options are `csv` and `json`.
- o (string - otuput) // Destination of the output, defaults to stdout. Other option is `file`.

Don’t forget -help flag for detailed usage information.

Error:

ansiwen gctx
2022/09/16 03:01:35 GET https://api.github.com/repos/ansiwen/gctx/license: 403 API rate limit exceeded 17. (But here’s the good news: Authenticated requests get a higher rate limit. Check out the documentattails.) [rate reset in 5s]

Solution:

https://github.com/settings/tokens create a token.

Then

export GITHUB_API_KEY=[new token]

Sample:
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值