mirror of
https://github.com/luxfi/mpc.git
synced 2026-09-24 00:26:24 +00:00
- Run goimports on all pkg files - Ensure consistent import grouping throughout codebase
14 lines
324 B
Go
14 lines
324 B
Go
package encoding
|
|
|
|
import "encoding/json"
|
|
|
|
// StructToJsonBytes converts a struct to JSON bytes
|
|
func StructToJsonBytes(v interface{}) ([]byte, error) {
|
|
return json.Marshal(v)
|
|
}
|
|
|
|
// JsonBytesToStruct converts JSON bytes to a struct
|
|
func JsonBytesToStruct(data []byte, v interface{}) error {
|
|
return json.Unmarshal(data, v)
|
|
}
|