Use other toml library

This commit is contained in:
Adnan Maolood 2021-05-10 12:15:58 -04:00
parent 28d241980a
commit d25dc206ff
3 changed files with 5 additions and 5 deletions

View file

@ -8,7 +8,7 @@ import (
"strings" "strings"
"text/template" "text/template"
"github.com/BurntSushi/toml" "github.com/pelletier/go-toml"
) )
// Config contains site configuration. // Config contains site configuration.
@ -43,7 +43,7 @@ func LoadConfig(path string) (*Config, error) {
defer f.Close() defer f.Close()
c := &Config{} c := &Config{}
if _, err := toml.DecodeReader(f, c); err != nil { if err := toml.NewDecoder(f).Decode(c); err != nil {
return nil, err return nil, err
} }

2
go.mod
View file

@ -3,6 +3,6 @@ module kiln
go 1.16 go 1.16
require ( require (
github.com/BurntSushi/toml v0.3.1 github.com/pelletier/go-toml v1.9.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
) )

4
go.sum
View file

@ -1,5 +1,5 @@
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/pelletier/go-toml v1.9.0 h1:NOd0BRdOKpPf0SxkL3HxSQOG7rNh+4kl6PHcBPFs7Q0=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/pelletier/go-toml v1.9.0/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=