Skip to content

Instantly share code, notes, and snippets.

@vitiko
Created February 20, 2019 05:34
Show Gist options
  • Save vitiko/325fa4e337c8ccef723f91a3bf4ff656 to your computer and use it in GitHub Desktop.
Save vitiko/325fa4e337c8ccef723f91a3bf4ff656 to your computer and use it in GitHub Desktop.
ToByter / From byter interfaces
type (
  // FromByter interface supports FromBytes func for converting from slice of bytes to target type
FromByter interface {
FromBytes([]byte) (interface{}, error)
}
// ToByter interface supports ToBytes func for converting to slice of bytes from source type
ToByter interface {
ToBytes() ([]byte, error)
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment