Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev committed Sep 28, 2024
1 parent 1557ca7 commit 3ec4307
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ A simple Golang library that contains license information from [SPDX](https://sp
See [spdx.org/licenses](https://spdx.org/licenses) for more details.

```go
license, ok := spdx.GetLicense("apache-2.0")
if ok {
if license, ok := spdx.LicenseForID("apache-2.0"); ok {
fmt.Println(license.ID()) // Apache-2.0
fmt.Println(license.Name()) // Apache License 2.0
fmt.Println(license.Reference()) // https://spdx.org/licenses/Apache-2.0.html
fmt.Println(license.DetailsURL()) // https://spdx.org/licenses/Apache-2.0.json
}

for _, license := range spdx.AllLicenses() {
fmt.Println(license)
}
```

## Status: Beta
Expand Down

0 comments on commit 3ec4307

Please sign in to comment.