https://github.com/mitchellh/go-spdx
Golang library for listing and looking up licenses using SPDX IDs.
https://github.com/mitchellh/go-spdx
licenses spdx
Last synced: about 1 month ago
JSON representation
Golang library for listing and looking up licenses using SPDX IDs.
- Host: GitHub
- URL: https://github.com/mitchellh/go-spdx
- Owner: mitchellh
- License: mit
- Created: 2018-11-17T19:49:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-17T20:44:05.000Z (almost 7 years ago)
- Last Synced: 2025-04-10T05:59:25.748Z (6 months ago)
- Topics: licenses, spdx
- Language: Go
- Size: 7.81 KB
- Stars: 23
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-spdx [](https://godoc.org/github.com/mitchellh/go-spdx)
go-spdx is a Go library for listing and looking up licenses using
[SPDX IDs](https://spdx.org/licenses/). SPDX IDs are an unambiguous way
to reference a specific software license. The IDs are looked up using the
spdx.org website (or custom URLs may be specified). Offline lookup is not
currently supported.This library does not implement the SPDX document format. SPDX document
parsing and printing are provided by other libraries, including a library
[in the official spdx organization](https://github.com/spdx/tools-go). This
library instead provides the ability to look up licenses via SPDX IDs.## Usage
```go
// Get the list of all known licenses
list, err := spdx.List()// Get a single license with more detail such as the license text
lic, err := spdx.License("MIT")// Create a custom client so you can control the HTTP client or the URLs
// that are used to access licenses.
client := &spdx.Client{ /* ... */ }
client.List()
client.License("MIT")
```