Move packages out of dirs

Fixes #2
This commit is contained in:
Daan Sprenkels
2019-09-15 17:43:09 +02:00
parent 66bbac8a8a
commit b7a4b1fee8
5 changed files with 8 additions and 8 deletions

View File

@@ -1,22 +0,0 @@
package gobmarsh
// Easier marshalling to and from gob encoding
import (
"bytes"
"encoding/gob"
)
func Marshal(v interface{}) ([]byte, error) {
b := new(bytes.Buffer)
err := gob.NewEncoder(b).Encode(v)
if err != nil {
return nil, err
}
return b.Bytes(), nil
}
func Unmarshal(data []byte, v interface{}) error {
b := bytes.NewBuffer(data)
return gob.NewDecoder(b).Decode(v)
}