Skip to content

Latest commit

 

History

History
executable file
·
35 lines (27 loc) · 1.12 KB

README.md

File metadata and controls

executable file
·
35 lines (27 loc) · 1.12 KB

sip

Lint commit message Push Release GitHub release

sip fills a Go struct with data from any sources.

Warning

This project is currently under development and not stable.

Usage

type MyConfig struct {
 Profile string        `sip:"profile"`
 User    *MyUserConfig `sip:"user"`
}

type MyUserConfig struct {
 Username string `sip:"username"`
 Password string `sip:"password"`
}

func main() {
 config := &MyConfig{}
 prefix := "my"

 sip.RegisterFile("examples/my.json")
 if err := sip.Fill(config, prefix); err != nil {
  panic(err)
 }
}