func (c Copyright) shebangInjectNotice(path string, file, notice []byte) []byte {
	// Strip shebang lines from beginning of file
	shebangLines := shebangMatch.Find(file)
	file = shebangMatch.ReplaceAll(file, nil)

	if c.fileHasCopyrightHeader(file, notice) {
		return nil
	}
	c.Verbosef("injecting notice: %s", path)

	// remove any existing notice-ish looking text ...
	file = c.removeCopyrightHeader(file, notice)
	return c.mergeFileSections(shebangLines, notice, file)
}
// shebangInjectNotice explicitly handles files that start with a shebang line.
// This assumes these are not `*.go` source files so has more in common with
// `injectNotice()` than with `goInjectNotice()`.
shebangInjectNotice explicitly handles files that start with a shebang line.
This assumes these are not `*.go` source files so has more in common with
`injectNotice()` than with `goInjectNotice()`.
// shebangInjectNotice explicitly handles files that start with a shebang line . // This assumes these are not ` * . go ` source files so has more in common with // ` injectNotice () ` than with ` goInjectNotice () ` .
func (c Copyright) shebangInjectNotice(path string, file, notice []byte) []byte {
	shebangLines := shebangMatch.Find(file)
	file = shebangMatch.ReplaceAll(file, nil)
	if c.fileHasCopyrightHeader(file, notice) {
		return nil
	}
	c.Verbosef("injecting notice: %s", path)
	file = c.removeCopyrightHeader(file, notice)
	return c.mergeFileSections(shebangLines, notice, file)
}
func ( c Copyright ) shebangInjectNotice ( path string , file , notice [ ] byte ) [ ] byte { shebangLines := shebangMatch . Find ( file ) file = shebangMatch . ReplaceAll ( file , nil ) if c . fileHasCopyrightHeader ( file , notice ) { return nil } c . Verbosef ( " " , path ) file = c . removeCopyrightHeader ( file , notice ) return c . mergeFileSections ( shebangLines , notice , file ) }
shebangInjectNotice explicitly handles files that start with a shebang line.
shebangInjectNotice explicitly handles files that start with a shebang line .
// Strip shebang lines from beginning of file // remove any existing notice-ish looking text ...