예제 #1
0
func main() {

	input, err := ioutil.ReadFile("model.xml")
	checkErr(err)

	m, err := govertabelo.Parse(input)
	checkErr(err)

	fmt.Println(m)

	for _, t := range m.Tables {
		fmt.Println(t.Name)
		for _, c := range t.Columns {
			fmt.Printf("  %-20s %-20s\n", c.Name, c.Type)
		}
	}
}
예제 #2
0
func describe_command(args []string) {

	if len(args) != 1 {
		log.Fatalln("missing file name")
	}

	filename := args[0]

	input, err := ioutil.ReadFile(filename)
	checkErr(err)

	m, err := govertabelo.Parse(input)
	checkErr(err)

	for _, t := range m.Tables {
		fmt.Println(t.Name)
		for _, c := range t.Columns {
			fmt.Printf("  %-20s %-20s\n", c.Name, c.Type)
		}
	}
}