[DO-169] Modify to add template with Avroid license

This commit is contained in:
Stanislav Gabenov
2024-04-10 14:47:27 +03:00
parent 4caba19b7e
commit 65deee00fd
2 changed files with 17 additions and 34 deletions

30
tmpl.go
View File

@@ -1,17 +1,3 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
@@ -25,6 +11,7 @@ import (
)
var licenseTemplate = map[string]string{
"Commercial": tmplCommercial,
"Apache-2.0": tmplApache,
"MIT": tmplMIT,
"bsd": tmplBSD,
@@ -34,9 +21,10 @@ var licenseTemplate = map[string]string{
// maintain backwards compatibility by mapping legacy license types to their
// SPDX equivalents.
var legacyLicenseTypes = map[string]string{
"apache": "Apache-2.0",
"mit": "MIT",
"mpl": "MPL-2.0",
"commercial": "Commercial",
"apache": "Apache-2.0",
"mit": "MIT",
"mpl": "MPL-2.0",
}
// licenseData specifies the data used to fill out a license template.
@@ -101,6 +89,14 @@ func executeTemplate(t *template.Template, d licenseData, top, mid, bot string)
return out.Bytes(), nil
}
const tmplCommercial = `Copyright {{.Holder}} {{ if .Year }} 2023-{{.Year}}{{ end }}
You can not use the contents of the file in any way without
AVROID, Ltd. written permission.
To obtain such a permit, you should contact AVROID, Ltd.
at https://avroid.ru`
const tmplApache = `Copyright{{ if .Year }} {{.Year}}{{ end }} {{.Holder}}
Licensed under the Apache License, Version 2.0 (the "License");