mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
cmd: Add a blank line between copyright and license
This commit is contained in:
parent
75c6acfc8f
commit
a1b7d3cc4d
5 changed files with 9 additions and 3 deletions
|
@ -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
cobra/cmd/testdata/main.go.golden
vendored
1
cobra/cmd/testdata/main.go.golden
vendored
|
@ -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
cobra/cmd/testdata/root.go.golden
vendored
1
cobra/cmd/testdata/root.go.golden
vendored
|
@ -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
cobra/cmd/testdata/test.go.golden
vendored
1
cobra/cmd/testdata/test.go.golden
vendored
|
@ -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 a new issue