From 40c31bd566b91d1a12a399fb34ce8adb452a2247 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 7 Dec 2017 15:36:14 -0800 Subject: [PATCH] added bsd license header --- main.go | 2 +- tmpl.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 2fe6401..0b16d04 100644 --- a/main.go +++ b/main.go @@ -44,7 +44,7 @@ Flags: var ( holder = flag.String("c", "Google Inc.", "copyright holder") - license = flag.String("l", "apache", "license type: apache, mit") + license = flag.String("l", "apache", "license type: apache, bsd, mit") year = flag.Int("y", time.Now().Year(), "year") ) diff --git a/tmpl.go b/tmpl.go index 095a708..73731f5 100644 --- a/tmpl.go +++ b/tmpl.go @@ -25,6 +25,7 @@ var licenseTemplate = make(map[string]*template.Template) func init() { licenseTemplate["apache"] = template.Must(template.New("").Parse(tmplApache)) licenseTemplate["mit"] = template.Must(template.New("").Parse(tmplMIT)) + licenseTemplate["bsd"] = template.Must(template.New("").Parse(tmplBSD)) } type copyrightData struct { @@ -78,6 +79,10 @@ 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.` +const tmplBSD = `Copyright (c) {{.Year}} {{.Holder}} All rights reserved. +Use of this source code is governed by a BSD-style +license that can be found in the LICENSE file.` + const tmplMIT = `Copyright (c) {{.Year}} {{.Holder}} Permission is hereby granted, free of charge, to any person obtaining a copy of