custom license from file
This commit is contained in:
committed by
Jacob McCann
parent
486fb589fd
commit
c63d25f5fc
9
tmpl.go
9
tmpl.go
@@ -36,14 +36,9 @@ type copyrightData struct {
|
||||
Holder string
|
||||
}
|
||||
|
||||
// prefix will execute a license template l with data d
|
||||
// prefix will execute a license template t with data d
|
||||
// and prefix the result with top, middle and bottom.
|
||||
func prefix(l string, d *copyrightData, top, mid, bot string) ([]byte, error) {
|
||||
t := licenseTemplate[l]
|
||||
if t == nil {
|
||||
return nil, fmt.Errorf("unknown license: %s", l)
|
||||
}
|
||||
|
||||
func prefix(t *template.Template, d *copyrightData, top, mid, bot string) ([]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
if err := t.Execute(&buf, d); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user