File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ func (a *Annotator) UnmarshalJSON(data []byte) error {
2222 annotatorStr := string (data )
2323 annotatorStr = strings .Trim (annotatorStr , "\" " )
2424
25- annotatorFields := strings .SplitN (annotatorStr , ": " , 2 )
25+ annotatorFields := strings .SplitN (annotatorStr , ":" , 2 )
2626
2727 if len (annotatorFields ) != 2 {
2828 return fmt .Errorf ("failed to parse Annotator '%s'" , annotatorStr )
2929 }
3030
31- a .AnnotatorType = annotatorFields [0 ]
32- a .Annotator = annotatorFields [1 ]
31+ a .AnnotatorType = strings . TrimSpace ( annotatorFields [0 ])
32+ a .Annotator = strings . TrimSpace ( annotatorFields [1 ])
3333
3434 return nil
3535}
Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ type Creator struct {
2222func (c * Creator ) UnmarshalJSON (data []byte ) error {
2323 str := string (data )
2424 str = strings .Trim (str , "\" " )
25- fields := strings .SplitN (str , ": " , 2 )
25+ fields := strings .SplitN (str , ":" , 2 )
2626
2727 if len (fields ) != 2 {
2828 return fmt .Errorf ("failed to parse Creator '%s'" , str )
2929 }
3030
31- c .CreatorType = fields [0 ]
32- c .Creator = fields [1 ]
31+ c .CreatorType = strings . TrimSpace ( fields [0 ])
32+ c .Creator = strings . TrimSpace ( fields [1 ])
3333
3434 return nil
3535}
Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ func (s *Supplier) UnmarshalJSON(data []byte) error {
2828 return nil
2929 }
3030
31- supplierFields := strings .SplitN (supplierStr , ": " , 2 )
31+ supplierFields := strings .SplitN (supplierStr , ":" , 2 )
3232
3333 if len (supplierFields ) != 2 {
3434 return fmt .Errorf ("failed to parse Supplier '%s'" , supplierStr )
3535 }
3636
37- s .SupplierType = supplierFields [0 ]
38- s .Supplier = supplierFields [1 ]
37+ s .SupplierType = strings . TrimSpace ( supplierFields [0 ])
38+ s .Supplier = strings . TrimSpace ( supplierFields [1 ])
3939
4040 return nil
4141}
You can’t perform that action at this time.
0 commit comments