status-go/mobile/utils.go

17 lines
306 B
Go
Raw Normal View History

2019-02-01 17:02:52 +00:00
package statusgo
import (
"encoding/json"
)
// ParseJSONArray parses JSON array into Go array of string.
func ParseJSONArray(items string) ([]string, error) {
var parsedItems []string
err := json.Unmarshal([]byte(items), &parsedItems)
if err != nil {
return nil, err
}
return parsedItems, nil
}