Matheus Sampaio Queiroga
78b1fdf255
All checks were successful
Test / Test (pull_request) Successful in 1m14s
Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
16 lines
265 B
Go
16 lines
265 B
Go
package structcode
|
|
|
|
import (
|
|
"bytes"
|
|
)
|
|
|
|
func Marshal(target any) ([]byte, error) {
|
|
buff := new(bytes.Buffer)
|
|
err := NewEncode(buff, target)
|
|
return buff.Bytes(), err
|
|
}
|
|
|
|
func Unmarshal(b []byte, target any) error {
|
|
return NewDecode(bytes.NewReader(b), target)
|
|
}
|