package application import ( "fmt" "github.com/BurntSushi/toml" ) type Configuration struct { Port int64 Host string Path string } func (c *Configuration) address() string { return fmt.Sprintf("%s:%d", c.Host, c.Port) } func ConfigFromToml(toml_data string) (*Configuration, error) { var config Configuration _, err := toml.Decode(toml_data, &config) if err != nil { return nil, err } return &config, nil }