dive/internal/utils/view.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

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
}