https://github.com/clavoie/binu
Binary / byte utilities for Go
https://github.com/clavoie/binu
go gob golang utilities
Last synced: about 1 month ago
JSON representation
Binary / byte utilities for Go
- Host: GitHub
- URL: https://github.com/clavoie/binu
- Owner: clavoie
- License: mit
- Created: 2018-08-29T12:32:02.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-29T13:08:59.000Z (almost 8 years ago)
- Last Synced: 2025-04-19T08:27:42.373Z (over 1 year ago)
- Topics: go, gob, golang, utilities
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# binu [](http://godoc.org/github.com/clavoie/erru) [](https://travis-ci.org/clavoie/erru) [](https://codecov.io/gh/clavoie/erru) [](https://goreportcard.com/report/github.com/clavoie/erru)
Binary / byte utilities for Go.
Currently this package is just a wrapper around the encoding/gob package, with hooks
for dependency injection.
```go
type Foo struct {
Value int
}
foo := &Foo{10}
bytes, err := binu.ToGob(foo)
// if err etc
newFoo := new(Foo)
err = binu.FromGob(bytes, newFoo)
// if err etc
// newFoo.Value == foo.Value
```
If you'd prefer to use dependency injection:
```go
func Serialize(gobber binu.Gobber) error {
err := gobber.To(value)
// etc
}
```