diff --git a/spdx/types.go b/spdx/types.go index 4007b2e..eef6d02 100644 --- a/spdx/types.go +++ b/spdx/types.go @@ -4,10 +4,6 @@ package spdx -import ( - "github.com/dave/jennifer/jen" -) - type License struct { Name string `json:"name"` Identifier string `json:"licenseId"` @@ -18,16 +14,3 @@ type License struct { Deprecated bool `json:"isDeprecatedLicenseId"` OSIApproved bool `json:"isOsiApproved"` } - -func (l *License) JenValue() jen.Dict { - return jen.Dict{ - jen.Id("Name"): jen.Lit(l.Name), - jen.Id("Identifier"): jen.Lit(l.Identifier), - jen.Id("Text"): jen.Lit(l.Text), - jen.Id("URIs"): jen.Lit(l.URIs), - jen.Id("StandardTemplate"): jen.Lit(l.StandardTemplate), - jen.Id("StandardHeader"): jen.Lit(l.StandardHeader), - jen.Id("Deprecated"): jen.Lit(l.Deprecated), - jen.Id("OSIApproved"): jen.Lit(l.OSIApproved), - } -} diff --git a/spdxgen/main.go b/spdxgen/main.go index 24233c5..9367a32 100644 --- a/spdxgen/main.go +++ b/spdxgen/main.go @@ -102,7 +102,16 @@ func render(pkg string, license spdx.License) string { // https://github.com/golang/go/issues/13560#issuecomment-277804473 f.HeaderComment("Code generated by github.com/joshdk/licensor/spdxgen. DO NOT EDIT.") - value := license.JenValue() + value := jen.Dict{ + jen.Id("Name"): jen.Lit(license.Name), + jen.Id("Identifier"): jen.Lit(license.Identifier), + jen.Id("Text"): jen.Lit(license.Text), + jen.Id("URIs"): jen.Lit(license.URIs), + jen.Id("StandardTemplate"): jen.Lit(license.StandardTemplate), + jen.Id("StandardHeader"): jen.Lit(license.StandardHeader), + jen.Id("Deprecated"): jen.Lit(license.Deprecated), + jen.Id("OSIApproved"): jen.Lit(license.OSIApproved), + } f.Func().Id("init").Params().Block( jen.Id("licenses").Op("=").Append(