From ded279a489631651943b5b65cdb3acb6764cf288 Mon Sep 17 00:00:00 2001 From: leshe4ka46 Date: Tue, 28 Oct 2025 13:42:55 +0300 Subject: unmarshal all formats, merge them in the single table, users are truly unique --- pkg/adapters/yaml/yaml.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'pkg/adapters/yaml/yaml.go') 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 } -- cgit v1.2.3