licenseheader

package
v0.0.0-...-26f4575 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package licenseheader handles license headers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Modify

func Modify(
	licenseType LicenseType,
	copyrightHolder string,
	yearRange string,
	filename string,
	data []byte,
) ([]byte, error)

Modify modifies the license header for the filename and data.

Returns the modified data, or the unmodified data if no modifications. If the filename extension is not handled, returns the unmodified data.

Note this only works with UTF-8 data with lines split by '\n'.

Types

type LicenseType

type LicenseType int

LicenseType is a recognized license type.

const (
	// LicenseTypeNone is the no license type.
	LicenseTypeNone LicenseType = iota + 1
	// LicenseTypeApache is the Apache 2.0 license type.
	LicenseTypeApache
	// LicenseTypeProprietary is the proprietary license type.
	LicenseTypeProprietary
)

func ParseLicenseType

func ParseLicenseType(s string) (LicenseType, error)

ParseLicenseType parses the LicenseType.

func (LicenseType) String

func (f LicenseType) String() string

String implements fmt.Stringer.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL