func main() { extensions, renderModes, renderer := parseFlags() gs := goskirt.Goskirt{extensions, renderModes} data, err := ioutil.ReadAll(os.Stdin) if err != nil { fmt.Println(err) os.Exit(1) } switch renderer { case goskirt.HTMLRenderer: gs.WriteHTML(os.Stdout, data) default: gs.WriteTOC(os.Stdout, data) } }