forked from TrueCloudLab/frostfs-node
[#1181] CLI: Simplify object type output
There is no need to switch between object types since `Type` implements `fmt.Stringer`. Replace swich-case in `printHeader` with `%s` format notation function. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
2181e033b8
commit
637077a883
1 changed files with 1 additions and 10 deletions
|
@ -861,16 +861,7 @@ func printHeader(cmd *cobra.Command, obj *object.Object) error {
|
||||||
cmd.Printf("Size: %d\n", obj.PayloadSize())
|
cmd.Printf("Size: %d\n", obj.PayloadSize())
|
||||||
cmd.Printf("HomoHash: %s\n", hex.EncodeToString(obj.PayloadHomomorphicHash().Sum()))
|
cmd.Printf("HomoHash: %s\n", hex.EncodeToString(obj.PayloadHomomorphicHash().Sum()))
|
||||||
cmd.Printf("Checksum: %s\n", hex.EncodeToString(obj.PayloadChecksum().Sum()))
|
cmd.Printf("Checksum: %s\n", hex.EncodeToString(obj.PayloadChecksum().Sum()))
|
||||||
switch obj.Type() {
|
cmd.Printf("Type: %s\n", obj.Type())
|
||||||
case object.TypeRegular:
|
|
||||||
cmd.Println("Type: regular")
|
|
||||||
case object.TypeTombstone:
|
|
||||||
cmd.Println("Type: tombstone")
|
|
||||||
case object.TypeStorageGroup:
|
|
||||||
cmd.Println("Type: storage group")
|
|
||||||
default:
|
|
||||||
cmd.Println("Type: unknown")
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Println("Attributes:")
|
cmd.Println("Attributes:")
|
||||||
for _, attr := range obj.Attributes() {
|
for _, attr := range obj.Attributes() {
|
||||||
|
|
Loading…
Reference in a new issue