Naming, layout and comments: descriptive full-word names, one item per line in wrapped calls and literals, and doc comments on exported names
Short and single-letter names in application code become full words (tests keep theirs). Wrapped calls, signatures and composite literals put one item per line, and one-line function bodies are expanded. Exported names and groups of constants get doc comments, and comments refer to the renamed identifiers.
This commit is contained in:
1 parent
043e307663
commit
465358609a
78 files changed
+2374
-1402
No files matched your search
@@ -11,18 +11,18 @@ import (
|
||||
)
|
||||
|
||||
// PrintTerminal prints the configuration to stdout as String formats it.
|
||||
func (conf JobSearchConfig) PrintTerminal() {
|
||||
fmt.Print(conf.String() + "\n")
|
||||
func (c JobSearchConfig) PrintTerminal() {
|
||||
fmt.Print(c.String() + "\n")
|
||||
}
|
||||
|
||||
// PrintJson prints the configuration to stdout as JSON.
|
||||
func (conf JobSearchConfig) PrintJson() {
|
||||
fmt.Print(conf.JSON() + "\n")
|
||||
func (c JobSearchConfig) PrintJson() {
|
||||
fmt.Print(c.JSON() + "\n")
|
||||
}
|
||||
|
||||
// PrintYaml prints the configuration to stdout as YAML.
|
||||
func (conf JobSearchConfig) PrintYaml() {
|
||||
fmt.Print(conf.YAML() + "\n")
|
||||
func (c JobSearchConfig) PrintYaml() {
|
||||
fmt.Print(c.YAML() + "\n")
|
||||
}
|
||||
|
||||
// PrintLog logs each configuration key and value, sorted by key, at atLevel:
|
||||
@@ -55,4 +55,4 @@ func (conf JobSearchConfig) PrintLog(atLevel slog.Level) {
|
||||
for _, key := range keys {
|
||||
logger.Log(ctx, atLevel, "config value", "key", key, "value", flat[key])
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user