@@ -21,14 +21,14 @@ import (
2121 "io/ioutil"
2222 "testing"
2323
24- "github.com/BurntSushi/toml"
2524 "github.com/containerd/containerd/oci"
2625 "github.com/containerd/containerd/plugin"
2726 "github.com/containerd/containerd/reference/docker"
2827 "github.com/containerd/containerd/runtime/linux/runctypes"
2928 runcoptions "github.com/containerd/containerd/runtime/v2/runc/options"
3029 imagedigest "github.com/opencontainers/go-digest"
3130 runtimespec "github.com/opencontainers/runtime-spec/specs-go"
31+ "github.com/pelletier/go-toml"
3232 "github.com/stretchr/testify/assert"
3333 "github.com/stretchr/testify/require"
3434
@@ -223,11 +223,16 @@ systemd_cgroup = true
223223 NoNewKeyring = true
224224`
225225 var nilOptsConfig , nonNilOptsConfig criconfig.Config
226- _ , err := toml .Decode (nilOpts , & nilOptsConfig )
226+ tree , err := toml .Load (nilOpts )
227227 require .NoError (t , err )
228- _ , err = toml . Decode ( nonNilOpts , & nonNilOptsConfig )
228+ err = tree . Unmarshal ( & nilOptsConfig )
229229 require .NoError (t , err )
230230 require .Len (t , nilOptsConfig .Runtimes , 3 )
231+
232+ tree , err = toml .Load (nonNilOpts )
233+ require .NoError (t , err )
234+ err = tree .Unmarshal (& nonNilOptsConfig )
235+ require .NoError (t , err )
231236 require .Len (t , nonNilOptsConfig .Runtimes , 3 )
232237
233238 for desc , test := range map [string ]struct {
0 commit comments