Skip to content

Commit 963beaa

Browse files
committed
clean wrong chars
1 parent 1999013 commit 963beaa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cli/device/list.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ func (r listResult) Data() interface{} {
9292
return r.devices
9393
}
9494

95+
func cleanStrings(serial string) string {
96+
serial = strings.Trim(serial, "\n")
97+
return strings.Trim(serial, " ")
98+
}
99+
95100
func (r listResult) String() string {
96101
if len(r.devices) == 0 {
97102
return "No devices found."
@@ -100,11 +105,11 @@ func (r listResult) String() string {
100105
t.SetHeader("Name", "ID", "Board", "FQBN", "SerialNumber", "Status", "Tags")
101106
for _, device := range r.devices {
102107
t.AddRow(
103-
device.Name,
108+
cleanStrings(device.Name),
104109
device.ID,
105110
device.Board,
106111
device.FQBN,
107-
device.Serial,
112+
cleanStrings(device.Serial),
108113
dereferenceString(device.Status),
109114
strings.Join(device.Tags, ","),
110115
)

0 commit comments

Comments
 (0)