Skip to content

Commit

Permalink
added bsd license header
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrydzewski committed Dec 7, 2017
1 parent 04bf3e3 commit 40c31bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)

Expand Down
5 changes: 5 additions & 0 deletions tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 40c31bd

Please sign in to comment.