package main import ( "encoding/json" "fmt" "io/ioutil" "os" "gitstore.ru/tolikproh/mchstest/internal/model" ) func main() { var inTest []model.MTType var outTest []model.MTParseT bs, err := ioutil.ReadFile("mchs_test.json") if err != nil { fmt.Println(err) os.Exit(1) } err = json.Unmarshal(bs, &inTest) if err != nil { fmt.Println(err) os.Exit(1) } for _, in := range inTest { outTest = append(outTest, in.Parse()) } fmt.Println(model.SaveToExel("mchs_test.xlsx", &outTest)) }