A Golang package for filling structs by random data.
go get github.com/HelpfulHuman/datafiller
package main
import (
"encoding/json"
"fmt"
"github.com/HelpfulHuman/datafiller"
)
type S struct {
A string
B struct {
C string
D string
E int
}
}
func main() {
i := S{}
datafiller.Fill(&i)
b, err := json.Marshal(i)
if err != nil {
return
}
fmt.Println(string(b))
}
- simple types
- structs
- slices
- packages
- simple tagged structs
- maps
- smart tagged struct generation
- guessing names by names
- add documentation
- functions
- all types
- add options for filling such as slice length