-
Basic case:
type MyStruct struct { Foo string Bar struct { One string Two string } } myStruct := MyStruct{} capil := capillarity.NewCapillarity() err := capil.Fill(&myStruct) if err != nil { log.Fatal(err) } fmt.Printf("%+v", myStruct) // output: {Foo:foobar Bar:{One:foobar Two:foobar}}
-
With options:
type MyStruct struct { Foo string Bar struct { One string Two int } } myStruct := MyStruct{} capil := capillarity.NewCapillarity(capillarity.WithDefaultString("go"), capillarity.WithDefaultNumber(6)) err := capil.Fill(&myStruct) if err != nil { log.Fatal(err) } fmt.Printf("%+v", myStruct) // output: {Foo:go Bar:{One:go Two:6}}
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
A simple object filler
License
ldez/go-capillarity
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A simple object filler
Topics
Resources
License
Code of conduct
Stars
Watchers
Forks
Packages 0
No packages published