Documentation
¶
Overview ¶
Package gogenlicense implements the gogenlicense command. See github.com/tkw1536/gogenlicense/cmd/gogenlicense.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindModulePath ¶ added in v1.2.0
FindModulePath finds the package path to the module containing path. This works by finding the path to 'go.mod', starting recursively at path.
Returns the package import path, if any. if no package import path exists, returns an error
Example ¶
// get the current directory - module containing this example dir, err := os.Getwd() if err != nil { panic(err) } // find the import path to the module module, err := FindModulePath(dir) if err != nil { panic(err) } fmt.Println(module)
Output: github.com/tkw1536/gogenlicense
func FindModuleRoot ¶ added in v1.2.0
FindModuleRoot finds the directory containing the module at path. This works by finding a directory containing 'go.mod', starting recursively at path.
Returns the path to a directory containing 'go.mod'. If no 'go.mod' file exists, returns an error.
Types ¶
type Library ¶
type Library struct { Path string Title string // like path, but with "Module" prefix LicenseName string LicenseText string LibraryURL string }
Library is an internal representation of a library
type Options ¶
type Options struct { // ModulePaths are go import paths to generate license information for. ModulePaths []string // By default the root modules are not used. // When set to true, include them. IncludeRoots bool // ConfidenceThreshold is the confidence threshold for the license classifier. // The default is 0.9. ConfidenceThreshold float64 // Name of the package to output OutPackage string // Name of the declaration DeclarationName string }
Options are options for the Format function.
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
gogenlicense
Command gogenlicense finds and formats package licenses for use in go programs.
|
Command gogenlicense finds and formats package licenses for use in go programs. |
Package legal contains legal notices of packages used by gogenlicense.
|
Package legal contains legal notices of packages used by gogenlicense. |