mirror of https://github.com/spf13/cobra.git
cmd: Add a blank line between copyright and license
This commit is contained in:
parent
75c6acfc8f
commit
a1b7d3cc4d
|
@ -121,7 +121,8 @@ func validateCmdName(source string) string {
|
||||||
|
|
||||||
func createCmdFile(license License, path, cmdName string) {
|
func createCmdFile(license License, path, cmdName string) {
|
||||||
template := `{{comment .copyright}}
|
template := `{{comment .copyright}}
|
||||||
{{comment .license}}
|
{{if .license}}//
|
||||||
|
{{comment .license}}{{end}}
|
||||||
|
|
||||||
package {{.cmdPackage}}
|
package {{.cmdPackage}}
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,8 @@ func createLicenseFile(license License, path string) {
|
||||||
|
|
||||||
func createMainFile(project *Project) {
|
func createMainFile(project *Project) {
|
||||||
mainTemplate := `{{ comment .copyright }}
|
mainTemplate := `{{ comment .copyright }}
|
||||||
{{if .license}}{{ comment .license }}{{end}}
|
{{if .license}}//
|
||||||
|
{{ comment .license }}{{end}}
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
@ -135,7 +136,8 @@ func main() {
|
||||||
|
|
||||||
func createRootCmdFile(project *Project) {
|
func createRootCmdFile(project *Project) {
|
||||||
template := `{{comment .copyright}}
|
template := `{{comment .copyright}}
|
||||||
{{if .license}}{{comment .license}}{{end}}
|
{{if .license}}//
|
||||||
|
{{comment .license}}{{end}}
|
||||||
|
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Copyright © 2017 NAME HERE <EMAIL ADDRESS>
|
// Copyright © 2017 NAME HERE <EMAIL ADDRESS>
|
||||||
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Copyright © 2017 NAME HERE <EMAIL ADDRESS>
|
// Copyright © 2017 NAME HERE <EMAIL ADDRESS>
|
||||||
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Copyright © 2017 NAME HERE <EMAIL ADDRESS>
|
// Copyright © 2017 NAME HERE <EMAIL ADDRESS>
|
||||||
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
|
|
Loading…
Reference in New Issue