summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-17 08:06:10 +0200
committerPaul Buetow <paul@buetow.org>2026-02-17 08:06:10 +0200
commitc680422366d7a4fc358917b8c8af5dd5bae792ae (patch)
tree69e6f787e8d5a2432a2b044dceaf3749d7938b52 /internal/config/config.go
parent41e25da4ccb3121ee9d22f8e9ad48568241d897c (diff)
Align codebase with Go best practices (ordering and style)v0.10.1
- Fix struct field alignment in Config and runState - Move parseBool() after Config methods (group methods together) - Move interface satisfaction checks after type definitions in store.go - Move linkScales var to top of display.go with other declarations - Clean up orphaned comment and blank line - Bump version to 0.10.1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 1b4c9e1..9daf6d2 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -24,14 +24,14 @@ type Config struct {
MaxWidth int
NetAverage int
NetLink string
- ShowAvgLine bool
- ShowIOAvgLine bool
- ShowCores bool
- ShowMem bool
+ ShowAvgLine bool
+ ShowIOAvgLine bool
+ ShowCores bool
+ ShowMem bool
ShowNet bool
ShowSeparators bool
SSHOpts string
- Cluster string
+ Cluster string
}
// Default returns a Config with default values.
@@ -182,11 +182,6 @@ func (c *Config) set(key, val string) {
}
}
-func parseBool(s string) bool {
- s = strings.TrimSpace(strings.ToLower(s))
- return s == "1" || s == "true" || s == "yes"
-}
-
func (c *Config) writeTo(f *os.File) error {
w := bufio.NewWriter(f)
writeInt := func(key string, v int) { fmt.Fprintf(w, "%s=%d\n", key, v) }
@@ -217,6 +212,11 @@ func (c *Config) writeTo(f *os.File) error {
return w.Flush()
}
+func parseBool(s string) bool {
+ s = strings.TrimSpace(strings.ToLower(s))
+ return s == "1" || s == "true" || s == "yes"
+}
+
func getClusterHostsRec(cluster, path string, depth int, seen map[string]bool) ([]string, error) {
if depth > constants.CSSHMaxRecursion {
return nil, fmt.Errorf("cluster recursion limit reached in %s (possible cycle)", path)