chore: improve trimming string from bytes
This commit is contained in:
parent
b86ef91ec2
commit
ddffab0599
1 changed files with 1 additions and 1 deletions
|
|
@ -44,7 +44,7 @@ const (
|
|||
|
||||
// ChargeStatusString converts a string to ChargeStatus
|
||||
func ChargeStatusString(s string) (ChargeStatus, error) {
|
||||
status := strings.ToUpper(s)
|
||||
status := strings.ToUpper(strings.TrimSpace(strings.Trim(s, "\x00")))
|
||||
switch s1 := status[:1]; s1 {
|
||||
case "A", "B":
|
||||
return ChargeStatus(s1), nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue