update lint and dependency (#2)
All checks were successful
Go Action / goaction (push) Successful in 33s
All checks were successful
Go Action / goaction (push) Successful in 33s
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
@@ -13,16 +13,18 @@ var (
|
||||
)
|
||||
|
||||
// Unmarshal by gob decoder.
|
||||
func Unmarshal(data []byte, v interface{}) error {
|
||||
func Unmarshal(data []byte, v any) error {
|
||||
buf := bytes.NewBuffer(data)
|
||||
|
||||
return gob.NewDecoder(buf).Decode(v)
|
||||
}
|
||||
|
||||
// Marshal by gob encoder.
|
||||
func Marshal(v interface{}) ([]byte, error) {
|
||||
func Marshal(v any) ([]byte, error) {
|
||||
var data bytes.Buffer
|
||||
if err := gob.NewEncoder(&data).Encode(v); err != nil {
|
||||
|
||||
err := gob.NewEncoder(&data).Encode(v)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user