pkg/config: Clean up godoc lint issues
This commit is contained in:
parent
4927bc6c7a
commit
2f746e1d3c
@ -15,7 +15,7 @@ const (
|
|||||||
configFile string = "config.yml"
|
configFile string = "config.yml"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Describes a rule for substitution of path to source code file.
|
// SubstitutePathRule describes a rule for substitution of path to source code file.
|
||||||
type SubstitutePathRule struct {
|
type SubstitutePathRule struct {
|
||||||
// Directory path will be substituted if it matches `From`.
|
// Directory path will be substituted if it matches `From`.
|
||||||
From string
|
From string
|
||||||
@ -23,7 +23,7 @@ type SubstitutePathRule struct {
|
|||||||
To string
|
To string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slice of source code path substitution rules.
|
// SubstitutePathRules is a slice of source code path substitution rules.
|
||||||
type SubstitutePathRules []SubstitutePathRule
|
type SubstitutePathRules []SubstitutePathRule
|
||||||
|
|
||||||
// Config defines all configuration options available to be set through the config file.
|
// Config defines all configuration options available to be set through the config file.
|
||||||
@ -93,6 +93,8 @@ func LoadConfig() *Config {
|
|||||||
return &c
|
return &c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SaveConfig will marshal and save the config struct
|
||||||
|
// to disk.
|
||||||
func SaveConfig(conf *Config) error {
|
func SaveConfig(conf *Config) error {
|
||||||
fullConfigFile, err := GetConfigFilePath(configFile)
|
fullConfigFile, err := GetConfigFilePath(configFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -117,11 +119,11 @@ func SaveConfig(conf *Config) error {
|
|||||||
func createDefaultConfig(path string) (*os.File, error) {
|
func createDefaultConfig(path string) (*os.File, error) {
|
||||||
f, err := os.Create(path)
|
f, err := os.Create(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Unable to create config file: %v.", err)
|
return nil, fmt.Errorf("unable to create config file: %v", err)
|
||||||
}
|
}
|
||||||
err = writeDefaultConfig(f)
|
err = writeDefaultConfig(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Unable to write default configuration: %v.", err)
|
return nil, fmt.Errorf("unable to write default configuration: %v", err)
|
||||||
}
|
}
|
||||||
return f, nil
|
return f, nil
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"unicode"
|
"unicode"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Like strings.Fields but ignores spaces inside areas surrounded
|
// SplitQuotedFields is like strings.Fields but ignores spaces inside areas surrounded
|
||||||
// by the specified quote character.
|
// by the specified quote character.
|
||||||
// To specify a single quote use backslash to escape it: '\''
|
// To specify a single quote use backslash to escape it: '\''
|
||||||
func SplitQuotedFields(in string, quote rune) []string {
|
func SplitQuotedFields(in string, quote rune) []string {
|
||||||
|
Loading…
Reference in New Issue
Block a user