mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-21 22:44:50 -04:00
refactor(tracker): use UnmarshalStrict when decoding embedded yamls
Since we have 100% control over what data gets embedded, there is no reason to embed anything that doesn't pass the strict yaml parsing and it's better we throw a panic right away so it's easy to catch this during development.
This commit is contained in:
parent
27bf8220c0
commit
ddbaf6a4bb
@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/vsariola/sointu"
|
||||
"github.com/vsariola/sointu/vm"
|
||||
"gopkg.in/yaml.v3"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
//go:generate go run generate/main.go
|
||||
@ -180,7 +180,7 @@ func init() {
|
||||
return nil
|
||||
}
|
||||
var instr sointu.Instrument
|
||||
if yaml.Unmarshal(data, &instr) == nil {
|
||||
if yaml.UnmarshalStrict(data, &instr) == nil {
|
||||
noExt := path[:len(path)-len(filepath.Ext(path))]
|
||||
splitted := splitPath(noExt)
|
||||
splitted = splitted[1:] // remove "presets" from the path
|
||||
|
Reference in New Issue
Block a user