mchstest/cmd/mtparse/main.go

32 lines
510 B
Go
Raw Normal View History

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