fixed all formatting errors

This commit is contained in:
christophe-duc 2026-01-07 18:54:05 -04:00
parent bb810d0523
commit 6677a039df
25 changed files with 122 additions and 122 deletions

View file

@ -6,9 +6,9 @@ import (
"os/exec"
"strings"
"github.com/go-errors/errors"
"github.com/christophe-duc/lazypodman/pkg/i18n"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/go-errors/errors"
"github.com/sasha-s/go-deadlock"
"github.com/sirupsen/logrus"
"golang.org/x/xerrors"

View file

@ -4,8 +4,8 @@ import (
"context"
"strings"
"github.com/fatih/color"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/fatih/color"
"github.com/samber/lo"
"github.com/sirupsen/logrus"
)

View file

@ -13,9 +13,9 @@ import (
"github.com/go-errors/errors"
"github.com/jesseduffield/kill"
"github.com/christophe-duc/lazypodman/pkg/config"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/jesseduffield/kill"
"github.com/mgutz/str"
"github.com/sirupsen/logrus"
)

View file

@ -12,11 +12,11 @@ import (
"sync"
"time"
"github.com/imdario/mergo"
"github.com/christophe-duc/lazypodman/pkg/commands/ssh"
"github.com/christophe-duc/lazypodman/pkg/config"
"github.com/christophe-duc/lazypodman/pkg/i18n"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/imdario/mergo"
"github.com/sasha-s/go-deadlock"
"github.com/sirupsen/logrus"
)
@ -27,15 +27,15 @@ const (
// PodmanCommand is our main podman interface
type PodmanCommand struct {
Log *logrus.Entry
OSCommand *OSCommand
Tr *i18n.TranslationSet
Config *config.AppConfig
Runtime ContainerRuntime
Log *logrus.Entry
OSCommand *OSCommand
Tr *i18n.TranslationSet
Config *config.AppConfig
Runtime ContainerRuntime
InComposeProject bool
ErrorChan chan error
ContainerMutex deadlock.Mutex
ServiceMutex deadlock.Mutex
ErrorChan chan error
ContainerMutex deadlock.Mutex
ServiceMutex deadlock.Mutex
Closers []io.Closer
}
@ -110,9 +110,9 @@ func NewPodmanCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.Translat
}
podmanCommand := &PodmanCommand{
Log: log,
OSCommand: osCommand,
Tr: tr,
Log: log,
OSCommand: osCommand,
Tr: tr,
Config: config,
Runtime: runtime,
ErrorChan: errorChan,

View file

@ -516,8 +516,8 @@ func convertLibpodContainerStats(stats *define.ContainerStats) ContainerStatsEnt
func convertLibpodImageList(ctx context.Context, imgs []*libimage.Image) []ImageSummary {
result := make([]ImageSummary, len(imgs))
for i, img := range imgs {
size, _ := img.Size() // Ignore error for list view
labels, _ := img.Labels(ctx) // Ignore error for list view
size, _ := img.Size() // Ignore error for list view
labels, _ := img.Labels(ctx) // Ignore error for list view
result[i] = ImageSummary{
ID: img.ID(),
RepoTags: img.Names(),

View file

@ -10,34 +10,34 @@ import (
// If a function is not set, the method returns sensible defaults or errors.
type MockRuntime struct {
// Container operation mocks
ListContainersFunc func(ctx context.Context) ([]ContainerSummary, error)
InspectContainerFunc func(ctx context.Context, id string) (*ContainerDetails, error)
StartContainerFunc func(ctx context.Context, id string) error
StopContainerFunc func(ctx context.Context, id string, timeout *int) error
PauseContainerFunc func(ctx context.Context, id string) error
UnpauseContainerFunc func(ctx context.Context, id string) error
RestartContainerFunc func(ctx context.Context, id string, timeout *int) error
RemoveContainerFunc func(ctx context.Context, id string, force bool, volumes bool) error
ContainerTopFunc func(ctx context.Context, id string) ([]string, [][]string, error)
PruneContainersFunc func(ctx context.Context) error
ContainerStatsFunc func(ctx context.Context, id string, stream bool) (<-chan ContainerStatsEntry, <-chan error)
ListContainersFunc func(ctx context.Context) ([]ContainerSummary, error)
InspectContainerFunc func(ctx context.Context, id string) (*ContainerDetails, error)
StartContainerFunc func(ctx context.Context, id string) error
StopContainerFunc func(ctx context.Context, id string, timeout *int) error
PauseContainerFunc func(ctx context.Context, id string) error
UnpauseContainerFunc func(ctx context.Context, id string) error
RestartContainerFunc func(ctx context.Context, id string, timeout *int) error
RemoveContainerFunc func(ctx context.Context, id string, force bool, volumes bool) error
ContainerTopFunc func(ctx context.Context, id string) ([]string, [][]string, error)
PruneContainersFunc func(ctx context.Context) error
ContainerStatsFunc func(ctx context.Context, id string, stream bool) (<-chan ContainerStatsEntry, <-chan error)
// Image operation mocks
ListImagesFunc func(ctx context.Context) ([]ImageSummary, error)
InspectImageFunc func(ctx context.Context, id string) (*ImageDetails, error)
ImageHistoryFunc func(ctx context.Context, id string) ([]ImageHistoryEntry, error)
RemoveImageFunc func(ctx context.Context, id string, force bool) error
PruneImagesFunc func(ctx context.Context) error
ListImagesFunc func(ctx context.Context) ([]ImageSummary, error)
InspectImageFunc func(ctx context.Context, id string) (*ImageDetails, error)
ImageHistoryFunc func(ctx context.Context, id string) ([]ImageHistoryEntry, error)
RemoveImageFunc func(ctx context.Context, id string, force bool) error
PruneImagesFunc func(ctx context.Context) error
// Volume operation mocks
ListVolumesFunc func(ctx context.Context) ([]VolumeSummary, error)
RemoveVolumeFunc func(ctx context.Context, name string, force bool) error
PruneVolumesFunc func(ctx context.Context) error
ListVolumesFunc func(ctx context.Context) ([]VolumeSummary, error)
RemoveVolumeFunc func(ctx context.Context, name string, force bool) error
PruneVolumesFunc func(ctx context.Context) error
// Network operation mocks
ListNetworksFunc func(ctx context.Context) ([]NetworkSummary, error)
RemoveNetworkFunc func(ctx context.Context, name string) error
PruneNetworksFunc func(ctx context.Context) error
ListNetworksFunc func(ctx context.Context) ([]NetworkSummary, error)
RemoveNetworkFunc func(ctx context.Context, name string) error
PruneNetworksFunc func(ctx context.Context) error
// Pod operation mocks
ListPodsFunc func(ctx context.Context) ([]PodSummary, error)

View file

@ -7,6 +7,7 @@ import (
"time"
"github.com/containers/podman/v5/libpod/define"
handlertypes "github.com/containers/podman/v5/pkg/api/handlers/types"
"github.com/containers/podman/v5/pkg/bindings"
"github.com/containers/podman/v5/pkg/bindings/containers"
"github.com/containers/podman/v5/pkg/bindings/images"
@ -16,7 +17,6 @@ import (
"github.com/containers/podman/v5/pkg/bindings/volumes"
"github.com/containers/podman/v5/pkg/domain/entities"
"github.com/containers/podman/v5/pkg/domain/entities/types"
handlertypes "github.com/containers/podman/v5/pkg/api/handlers/types"
nettypes "go.podman.io/common/libnetwork/types"
)
@ -520,17 +520,17 @@ func convertPodmanImageInspect(data *entities.ImageInspectReport) *ImageDetails
}
details := &ImageDetails{
ID: data.ID,
RepoTags: data.RepoTags,
RepoDigests: data.RepoDigests,
Parent: data.Parent,
Comment: data.Comment,
Created: *data.Created,
Author: data.Author,
Architecture: data.Architecture,
Os: data.Os,
Size: data.Size,
VirtualSize: data.VirtualSize,
ID: data.ID,
RepoTags: data.RepoTags,
RepoDigests: data.RepoDigests,
Parent: data.Parent,
Comment: data.Comment,
Created: *data.Created,
Author: data.Author,
Architecture: data.Architecture,
Os: data.Os,
Size: data.Size,
VirtualSize: data.VirtualSize,
}
if data.RootFS != nil {

View file

@ -90,27 +90,27 @@ type HealthLog struct {
// ContainerConfig represents container configuration.
type ContainerConfig struct {
Hostname string
Domainname string
User string
AttachStdin bool
AttachStdout bool
AttachStderr bool
ExposedPorts map[string]struct{}
Tty bool
OpenStdin bool
StdinOnce bool
Env []string
Cmd []string
Image string
Volumes map[string]struct{}
WorkingDir string
Entrypoint []string
OnBuild []string
Labels map[string]string
StopSignal string
StopTimeout *int
Shell []string
Hostname string
Domainname string
User string
AttachStdin bool
AttachStdout bool
AttachStderr bool
ExposedPorts map[string]struct{}
Tty bool
OpenStdin bool
StdinOnce bool
Env []string
Cmd []string
Image string
Volumes map[string]struct{}
WorkingDir string
Entrypoint []string
OnBuild []string
Labels map[string]string
StopSignal string
StopTimeout *int
Shell []string
}
// NetworkSettings represents container network settings.
@ -304,23 +304,23 @@ type ImageSummary struct {
// ImageDetails provides full image inspection data.
type ImageDetails struct {
ID string
RepoTags []string
RepoDigests []string
Parent string
Comment string
Created time.Time
Container string
DockerVersion string
Author string
Config *ContainerConfig
Architecture string
Os string
OsVersion string
Size int64
VirtualSize int64
RootFS RootFS
Metadata ImageMetadata
ID string
RepoTags []string
RepoDigests []string
Parent string
Comment string
Created time.Time
Container string
DockerVersion string
Author string
Config *ContainerConfig
Architecture string
Os string
OsVersion string
Size int64
VirtualSize int64
RootFS RootFS
Metadata ImageMetadata
}
// RootFS represents the root filesystem of an image.

View file

@ -71,15 +71,15 @@ func TestContainerDetailsFields(t *testing.T) {
Image: "alpine:latest",
ImageID: "sha256:abc123",
Config: &ContainerConfig{
Hostname: "myhost",
User: "root",
Tty: true,
Env: []string{"PATH=/usr/bin"},
Cmd: []string{"sleep", "infinity"},
WorkingDir: "/app",
Entrypoint: []string{"/entrypoint.sh"},
Labels: map[string]string{"version": "1.0"},
StopSignal: "SIGTERM",
Hostname: "myhost",
User: "root",
Tty: true,
Env: []string{"PATH=/usr/bin"},
Cmd: []string{"sleep", "infinity"},
WorkingDir: "/app",
Entrypoint: []string{"/entrypoint.sh"},
Labels: map[string]string{"version": "1.0"},
StopSignal: "SIGTERM",
},
NetworkSettings: &NetworkSettings{
Bridge: "bridge0",

View file

@ -3,8 +3,8 @@ package gui
import (
"time"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/jesseduffield/gocui"
)
type appStatus struct {

View file

@ -1,9 +1,9 @@
package gui
import (
"github.com/jesseduffield/lazycore/pkg/boxlayout"
"github.com/christophe-duc/lazypodman/pkg/gui/panels"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/jesseduffield/lazycore/pkg/boxlayout"
"github.com/mattn/go-runewidth"
"github.com/samber/lo"
)

View file

@ -8,10 +8,10 @@ import (
"os/signal"
"time"
"github.com/fatih/color"
"github.com/christophe-duc/lazypodman/pkg/commands"
"github.com/christophe-duc/lazypodman/pkg/tasks"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/fatih/color"
)
func (gui *Gui) renderContainerLogsToMain(container *commands.Container) tasks.TaskFunc {

View file

@ -6,8 +6,6 @@ import (
"strings"
"time"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/commands"
"github.com/christophe-duc/lazypodman/pkg/config"
"github.com/christophe-duc/lazypodman/pkg/gui/panels"
@ -15,6 +13,8 @@ import (
"github.com/christophe-duc/lazypodman/pkg/gui/types"
"github.com/christophe-duc/lazypodman/pkg/tasks"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/samber/lo"
)

View file

@ -1,11 +1,11 @@
package gui
import (
"github.com/fatih/color"
"github.com/christophe-duc/lazypodman/pkg/commands"
"github.com/christophe-duc/lazypodman/pkg/config"
"github.com/christophe-duc/lazypodman/pkg/gui/types"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/fatih/color"
"github.com/samber/lo"
)

View file

@ -1,9 +1,9 @@
package gui
import (
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/gookit/color"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/utils"
)
var gocuiColorMap = map[string]gocui.Attribute{

View file

@ -9,14 +9,14 @@ import (
"github.com/go-errors/errors"
throttle "github.com/boz/go-throttle"
"github.com/jesseduffield/gocui"
lcUtils "github.com/jesseduffield/lazycore/pkg/utils"
"github.com/christophe-duc/lazypodman/pkg/commands"
"github.com/christophe-duc/lazypodman/pkg/config"
"github.com/christophe-duc/lazypodman/pkg/gui/panels"
"github.com/christophe-duc/lazypodman/pkg/gui/types"
"github.com/christophe-duc/lazypodman/pkg/i18n"
"github.com/christophe-duc/lazypodman/pkg/tasks"
"github.com/jesseduffield/gocui"
lcUtils "github.com/jesseduffield/lazycore/pkg/utils"
"github.com/sasha-s/go-deadlock"
"github.com/sirupsen/logrus"
)

View file

@ -5,8 +5,6 @@ import (
"strings"
"time"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/commands"
"github.com/christophe-duc/lazypodman/pkg/config"
"github.com/christophe-duc/lazypodman/pkg/gui/panels"
@ -14,6 +12,8 @@ import (
"github.com/christophe-duc/lazypodman/pkg/gui/types"
"github.com/christophe-duc/lazypodman/pkg/tasks"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/samber/lo"
)

View file

@ -3,8 +3,6 @@ package gui
import (
"strconv"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/commands"
"github.com/christophe-duc/lazypodman/pkg/config"
"github.com/christophe-duc/lazypodman/pkg/gui/panels"
@ -12,6 +10,8 @@ import (
"github.com/christophe-duc/lazypodman/pkg/gui/types"
"github.com/christophe-duc/lazypodman/pkg/tasks"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/samber/lo"
)

View file

@ -3,8 +3,8 @@ package gui
import (
"github.com/samber/lo"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/gui/types"
"github.com/jesseduffield/gocui"
)
func (gui *Gui) getBindings(v *gocui.View) []*Binding {

View file

@ -5,10 +5,10 @@ import (
"fmt"
"strings"
"github.com/go-errors/errors"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/tasks"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/go-errors/errors"
"github.com/jesseduffield/gocui"
"github.com/samber/lo"
)

View file

@ -6,13 +6,13 @@ import (
"path"
"strings"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/commands"
"github.com/christophe-duc/lazypodman/pkg/gui/panels"
"github.com/christophe-duc/lazypodman/pkg/gui/presentation"
"github.com/christophe-duc/lazypodman/pkg/tasks"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/yaml"
)

View file

@ -5,8 +5,6 @@ import (
"fmt"
"time"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/commands"
"github.com/christophe-duc/lazypodman/pkg/config"
"github.com/christophe-duc/lazypodman/pkg/gui/panels"
@ -14,6 +12,8 @@ import (
"github.com/christophe-duc/lazypodman/pkg/gui/types"
"github.com/christophe-duc/lazypodman/pkg/tasks"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/samber/lo"
)

View file

@ -8,8 +8,8 @@ import (
"os/signal"
"strings"
"github.com/fatih/color"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/fatih/color"
)
func (gui *Gui) runSubprocess(cmd *exec.Cmd) error {

View file

@ -5,9 +5,9 @@ import (
"sort"
"strings"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/gui/panels"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/jesseduffield/gocui"
"github.com/samber/lo"
"github.com/spkg/bom"
)

View file

@ -3,8 +3,6 @@ package gui
import (
"fmt"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/christophe-duc/lazypodman/pkg/commands"
"github.com/christophe-duc/lazypodman/pkg/config"
"github.com/christophe-duc/lazypodman/pkg/gui/panels"
@ -12,6 +10,8 @@ import (
"github.com/christophe-duc/lazypodman/pkg/gui/types"
"github.com/christophe-duc/lazypodman/pkg/tasks"
"github.com/christophe-duc/lazypodman/pkg/utils"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/samber/lo"
)