Skip to content

A Golang package for filling structs by random data.

License

Notifications You must be signed in to change notification settings

jmptrader/datafiller

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datafiller

Build Status GoDoc

A Golang package for filling structs by random data.

Installation

go get github.com/erggo/datafiller

Sample Usage

package main

import (
	"encoding/json"
	"fmt"
	"github.com/erggo/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))
}

TODO

  • 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

About

A Golang package for filling structs by random data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%