Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 843 Bytes

README.md

File metadata and controls

40 lines (31 loc) · 843 Bytes

assign

Go Reference

Package assign assigns values of any source to Go values.

Examples

Assign to a Go value from any source.

err := assign.ToFrom(dst, src)

Assign from any source to a Go value.

err := assign.From(src).To(dst)

Assign with assign.WithTags option.

err := assign.ToFrom(dst, src, assign.WithTags("json"))

Assign with assign.WithoutCycle option.

err := assign.ToFrom(dst, src, assign.WithoutCycle())

Assign from an assign.Source.

src := assign.Of(val)
err := assign.ToFrom(dst, src)

Assign from assign.Assigner to multiple Go values.

assigner := assign.From(src)
err := assigner.To(dst)
errAnother := assigner.To(dstAnother)