package module
v2.6.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 16 Imported by: 0



Build Status Coverage Status Go Report Card

Golang license and dependency checker. Prints list of all dependencies, their URL, license and saves all the license files in /licenses.


glice analyzes the go.mod file of your project and prints it in a tabular format - name, URL, and license short-name (MIT, GPL...).


Download and install glice by executing:

    go install

To update:

    go get -u


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


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

    glice -p ""

By default glice:

  • Prints only 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 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
- 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__

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

Using glice inside as a library

As of v2.0.0 glice can be used as a library and provides few functions/methods that return list of dependencies in structured format and printing to io.Writer.

Sample output

Executing glice -c on prints (with additional colors for links and licenses):

|            DEPENDENCY             |                  REPOURL                  |   LICENSE    |
|            |            | MIT          |
|       |       | bsd-3-clause |
|      |      | Other        |
| | | MIT          |
|                  |           |              |
|               |        |              |


glice is licensed under the MIT license. Check the LICENSE file for details.


Emir Ribic




This section is empty.


View Source
var (
	// ErrNoGoMod is returned when path doesn't contain go.mod file
	ErrNoGoMod = errors.New("no go.mod file present")

	// ErrNoAPIKey is returned when thanks flag is enabled without providing GITHUB_API_KEY env variable
	ErrNoAPIKey = errors.New("cannot use thanks feature without github api key")


func Print

func Print(path string, indirect bool, writeTo io.Writer) error


type Client

type Client struct {
	// contains filtered or unexported fields

func NewClient

func NewClient(path string) (*Client, error)

func (*Client) ParseDependencies

func (c *Client) ParseDependencies(includeIndirect, thanks bool) error

func (*Client) Print

func (c *Client) Print(output io.Writer)

func (*Client) WriteLicensesToFile

func (c *Client) WriteLicensesToFile() error

type Repository

type Repository struct {
	Name      string
	Shortname string
	URL       string
	Host      string
	Author    string
	Project   string
	Text      string

Repository holds information about the repository

func ListRepositories

func ListRepositories(path string, withIndirect bool) ([]*Repository, error)


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL