mirror of
https://github.com/wagoodman/dive
synced 2026-03-14 22:35:50 +01:00
* 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>
21 lines
474 B
Go
21 lines
474 B
Go
package utils
|
|
|
|
import (
|
|
"errors"
|
|
"github.com/awesome-gocui/gocui"
|
|
"github.com/wagoodman/dive/internal/log"
|
|
)
|
|
|
|
// IsNewView determines if a view has already been created based on the set of errors given (a bit hokie)
|
|
func IsNewView(errs ...error) bool {
|
|
for _, err := range errs {
|
|
if err == nil {
|
|
return false
|
|
}
|
|
if !errors.Is(err, gocui.ErrUnknownView) {
|
|
log.WithFields("error", err).Error("IsNewView() unexpected error")
|
|
return true
|
|
}
|
|
}
|
|
return true
|
|
}
|