summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authoryyzxw <1020938856@qq.com>2024-01-18 14:57:30 +0800
committerxiaowu.zhu <xiaowu.zhu@daocloud.io>2024-01-23 09:40:55 +0800
commitf53cb9c2771bb4644b2aa89478f321d021b60c5b (patch)
treef69ac29a91579c3d5f6cc3236e2e27f1e71c348e /cmd
parent20b22f8f100c4465ad15db33e8b09f2337327cb6 (diff)
chore: remove unused file [NO NEW TESTS NEEDED]
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/diffChanges.go42
1 files changed, 0 insertions, 42 deletions
diff --git a/cmd/podman/common/diffChanges.go b/cmd/podman/common/diffChanges.go
deleted file mode 100644
index 6d4c7154a..000000000
--- a/cmd/podman/common/diffChanges.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package common
-
-import (
- "fmt"
- "os"
-
- "github.com/containers/podman/v4/pkg/domain/entities"
- "github.com/containers/storage/pkg/archive"
-)
-
-type ChangesReportJSON struct {
- Changed []string `json:"changed,omitempty"`
- Added []string `json:"added,omitempty"`
- Deleted []string `json:"deleted,omitempty"`
-}
-
-func ChangesToJSON(diffs *entities.DiffReport) error {
- body := ChangesReportJSON{}
- for _, row := range diffs.Changes {
- switch row.Kind {
- case archive.ChangeAdd:
- body.Added = append(body.Added, row.Path)
- case archive.ChangeDelete:
- body.Deleted = append(body.Deleted, row.Path)
- case archive.ChangeModify:
- body.Changed = append(body.Changed, row.Path)
- default:
- return fmt.Errorf("output kind %q not recognized", row.Kind)
- }
- }
-
- // Pull in configured json library
- enc := json.NewEncoder(os.Stdout)
- return enc.Encode(body)
-}
-
-func ChangesToTable(diffs *entities.DiffReport) error {
- for _, row := range diffs.Changes {
- fmt.Fprintln(os.Stdout, row.String())
- }
- return nil
-}