element/config/utils.go
Evan Hazlett 7574b334cc
start on api
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-07-29 10:11:50 -04:00

15 lines
286 B
Go

package config
import (
"github.com/BurntSushi/toml"
)
// ParseConfig returns a Config object from a raw string config TOML
func ParseConfig(data string) (*Config, error) {
var cfg Config
if _, err := toml.Decode(data, &cfg); err != nil {
return nil, err
}
return &cfg, nil
}