提交 2f746e1d 编写于 作者: D Derek Parker 提交者: Derek Parker

pkg/config: Clean up godoc lint issues

上级 4927bc6c
......@@ -15,7 +15,7 @@ const (
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 {
// Directory path will be substituted if it matches `From`.
From string
......@@ -23,7 +23,7 @@ type SubstitutePathRule struct {
To string
}
// Slice of source code path substitution rules.
// SubstitutePathRules is a slice of source code path substitution rules.
type SubstitutePathRules []SubstitutePathRule
// Config defines all configuration options available to be set through the config file.
......@@ -93,6 +93,8 @@ func LoadConfig() *Config {
return &c
}
// SaveConfig will marshal and save the config struct
// to disk.
func SaveConfig(conf *Config) error {
fullConfigFile, err := GetConfigFilePath(configFile)
if err != nil {
......@@ -117,11 +119,11 @@ func SaveConfig(conf *Config) error {
func createDefaultConfig(path string) (*os.File, error) {
f, err := os.Create(path)
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)
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
}
......
......@@ -5,7 +5,7 @@ import (
"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.
// To specify a single quote use backslash to escape it: '\''
func SplitQuotedFields(in string, quote rune) []string {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册