Categorygithub.com/roryq/go-typemapper
modulepackage
0.2.1
Repository: https://github.com/roryq/go-typemapper.git
Documentation: pkg.go.dev

# README

typemapper

Convention based code generator to simplify mapping between similar structs in Go.

Copying data between similar, but slightly different, structs is error-prone, especially as the size of struct increases. typemapper simplifies the process using common conventions to automatically generate mapping functions and helps ensure no fields are left out the copying process but generating unit test files that fail when one is missed.

How it Works

See the Tutorial.

TODO

  • Sync tutorial example files with markdown doc

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

CreateMap initiates a mapping from the src type to the dst type.
IgnoreFields tells the map to ignore certain destination fields.
IgnoreUnexported tells the map to ignore unexported destination fields.
MapField tells the map to explicitly match fields that would otherwise not match.
MapWith provides additional mapping functions to use for type conversions.
RecognizePrefixes tells the map to match fields where the names match ignoring certain prefixes.