From c680422366d7a4fc358917b8c8af5dd5bae792ae Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 17 Feb 2026 08:06:10 +0200 Subject: Align codebase with Go best practices (ordering and style) - 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 --- internal/config/config.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'internal/config') 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) -- cgit v1.2.3