From 1686c9a6a9e5354a94cf5ad4854d47ccfd017000 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 13 Dec 2019 22:33:23 -0800 Subject: [PATCH] Add small_config.yml for testing Signed-off-by: Chris Cummer --- _sample_configs/small_config.yml | 17 +++++++++++++++++ utils/sums.go | 12 ++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 _sample_configs/small_config.yml create mode 100644 utils/sums.go diff --git a/_sample_configs/small_config.yml b/_sample_configs/small_config.yml new file mode 100644 index 00000000..82e91e89 --- /dev/null +++ b/_sample_configs/small_config.yml @@ -0,0 +1,17 @@ +wtf: + grid: + columns: [20, 20] + rows: [3, 3] + refreshInterval: 1 + mods: + uptime: + type: cmdrunner + args: [""] + cmd: "uptime" + enabled: true + position: + top: 0 + left: 0 + height: 1 + width: 1 + refreshInterval: 30 \ No newline at end of file diff --git a/utils/sums.go b/utils/sums.go new file mode 100644 index 00000000..0f45fca5 --- /dev/null +++ b/utils/sums.go @@ -0,0 +1,12 @@ +package utils + +// SumInts takes a slice of ints and returns the sum of them +func SumInts(vals []int) int { + sum := 0 + + for _, a := range vals { + sum += a + } + + return sum +}