Skip to content

Commit

Permalink
fix: do not print extra space when there's no label
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Dec 15, 2023
1 parent 0632fac commit d407c88
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/commands/pin/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ Example:
if stream {
if quiet {
fmt.Fprintf(w, "%s\n", out.PinLsObject.Cid)
} else if out.PinLsObject.Label == "" {

Check warning on line 408 in core/commands/pin/pin.go

View check run for this annotation

Codecov / codecov/patch

core/commands/pin/pin.go#L408

Added line #L408 was not covered by tests
fmt.Fprintf(w, "%s %s\n", out.PinLsObject.Cid, out.PinLsObject.Type)
} else {
fmt.Fprintf(w, "%s %s %s\n", out.PinLsObject.Cid, out.PinLsObject.Type, out.PinLsObject.Label)

Check warning on line 411 in core/commands/pin/pin.go

View check run for this annotation

Codecov / codecov/patch

core/commands/pin/pin.go#L410-L411

Added lines #L410 - L411 were not covered by tests
}
Expand All @@ -414,6 +416,8 @@ Example:
for k, v := range out.PinLsList.Keys {
if quiet {
fmt.Fprintf(w, "%s\n", k)
} else if v.Label == "" {

Check warning on line 419 in core/commands/pin/pin.go

View check run for this annotation

Codecov / codecov/patch

core/commands/pin/pin.go#L419

Added line #L419 was not covered by tests
fmt.Fprintf(w, "%s %s\n", k, v.Type)
} else {
fmt.Fprintf(w, "%s %s %s\n", k, v.Type, v.Label)

Check warning on line 422 in core/commands/pin/pin.go

View check run for this annotation

Codecov / codecov/patch

core/commands/pin/pin.go#L421-L422

Added lines #L421 - L422 were not covered by tests
}
Expand Down

0 comments on commit d407c88

Please sign in to comment.