mchstest/cmd/mtparse/main.go
2023-01-19 15:10:14 +10:00

32 lines
510 B
Go

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))
}