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

pkg/config: Clean up godoc lint issues

上级 4927bc6c
...@@ -15,7 +15,7 @@ const ( ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 ( ...@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册