encoding

package
v0.0.0-...-b42ad41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2020 License: MIT Imports: 2 Imported by: 0

README

go-utils/encoding

This provides utility functions relating to encodings. Currently provided functions are:

  • Marshal(interface{}) ([]byte, error) / Unmarshal([]byte, interface{}) error: These functions encapsulate converting a struct to a byte slice and back to the original struct. The gob package is used under the hood.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(o interface{}) ([]byte, error)

Marshal converts the given struct to a byte slice.

func Unmarshal

func Unmarshal(data []byte, o interface{}) error

Unmarshal reads from the byte slice `data` and decodes the struct into `o`.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL