github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/pkg/config/read.go (about) 1 package config 2 3 import ( 4 "os" 5 6 "github.com/pelletier/go-toml/v2" 7 ) 8 9 // ReadToml reads the toml config file into the given struct 10 func ReadToml(inFile string, destination interface{}) error { 11 bytes, err := os.ReadFile(inFile) 12 if err != nil { 13 return err 14 } 15 16 return toml.Unmarshal(bytes, destination) 17 }