diff options
| author | leshe4ka46 <alex9102naid1@ya.ru> | 2025-10-28 13:42:55 +0300 |
|---|---|---|
| committer | leshe4ka46 <alex9102naid1@ya.ru> | 2025-10-28 13:43:08 +0300 |
| commit | ded279a489631651943b5b65cdb3acb6764cf288 (patch) | |
| tree | 9ea2c846f5efdab6521b4e7236dcbea34c9b544b /pkg/adapters/yaml | |
| parent | bb833561aa74f02970aee13cdc75973b29716491 (diff) | |
unmarshal all formats, merge them in the single table, users are truly unique
Diffstat (limited to 'pkg/adapters/yaml')
| -rw-r--r-- | pkg/adapters/yaml/yaml.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pkg/adapters/yaml/yaml.go b/pkg/adapters/yaml/yaml.go index 9a79a72..9304c8f 100644 --- a/pkg/adapters/yaml/yaml.go +++ b/pkg/adapters/yaml/yaml.go @@ -16,8 +16,6 @@ import ( "gopkg.in/yaml.v3" ) -// ---------- Data model ---------- - type FareInfo struct { Class string `yaml:"CLASS" json:"class"` Fare string `yaml:"FARE" json:"fare"` @@ -34,13 +32,12 @@ type Schedule struct { data map[string]map[string]Flight } -// ParseSchedule reads YAML from r into a Schedule. func ParseSchedule(r io.Reader) (*Schedule, error) { s := &Schedule{ data: make(map[string]map[string]Flight), } dec := yaml.NewDecoder(r) - // dec.KnownFields(true) // enable if you want strict field checking + // dec.KnownFields(true) // strict field checking if err := dec.Decode(&s.data); err != nil { return nil, err } |
