2023-10-31 23:19:52 +00:00
|
|
|
package aid
|
|
|
|
|
2023-12-19 16:47:13 +00:00
|
|
|
import "github.com/goccy/go-json"
|
|
|
|
|
|
|
|
type JSON map[string]interface{}
|
|
|
|
|
|
|
|
func JSONFromBytes(input []byte) JSON {
|
|
|
|
var output JSON
|
|
|
|
json.Unmarshal(input, &output)
|
|
|
|
return output
|
|
|
|
}
|
|
|
|
|
|
|
|
func (j *JSON) ToBytes() []byte {
|
|
|
|
json, _ := json.Marshal(j)
|
|
|
|
return json
|
|
|
|
}
|