package main import ( "fmt" "os" ) func main() { // show usage if config file is missing if len(os.Args) < 2 { fmt.Println("Usage: godocs ") os.Exit(1) } // read config file specified in the command line cfg, err := readConfig(os.Args[1]) if err != nil { panic(err) } // collect all entries entries, err := findEntries(cfg) if err != nil { panic(err) } // render all entries pages := createPageMap(entries) fmt.Println("Pages:") fmt.Println(pages) // create navigation item slice navItems := createNavSlice(pages, cfg) fmt.Println("Navigation:") fmt.Println(navItems) generatePages(pages, navItems, cfg) }