2016-11-05 17:12:24 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
)
|
|
|
|
|
2018-03-29 09:20:55 +00:00
|
|
|
// 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
|
2017-05-03 14:24:48 +00:00
|
|
|
}
|
2017-03-15 21:03:01 +00:00
|
|
|
|
2018-03-29 09:20:55 +00:00
|
|
|
return parsedItems, nil
|
2017-08-10 15:31:29 +00:00
|
|
|
}
|