dive/internal/utils/format.go
Alex Goodman 788fcd3834
chore: refactor command structure (#587)
* refactor cli harness

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* use single configuration for ui

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* remove remaining viper rules

* add basic CLI tests

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* separate cmd and api concerns for keybindings

* plumb through context for future logging

* port to using internal logger

* internalize non-analysis path

* encapsulate ui with clio

* merge runtime into cmd + add adapter package

* support legacy config shapes

* improve testing around formatting

* fix log-ui interactions

* fix linting and update test snapshots

* fix initialization of tree viewmodel

* indent files in report

* fix build

* setup qemu and buildx in release workflow

* show formatted output in CI

* add cli tests for source flag

* add default ci config cli test

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
2025-04-08 12:19:18 -04:00

16 lines
259 B
Go

package utils
import (
"strings"
)
// CleanArgs trims the whitespace from the given set of strings.
func CleanArgs(s []string) []string {
var r []string
for _, str := range s {
if str != "" {
r = append(r, strings.Trim(str, " "))
}
}
return r
}