Exemple #1
0
func main() {
	js.AddRoute("/", mainPage)
	js.RouterRun()

	response, err := http.Get("/edict")
	if err != nil {
		log.Panic(err)
	}

	var dictionary libkanji.Dictionary

	go func() {
		now := time.Now()
		log.Println("Started parsing dictionary this will take a while ...")
		dictionary = libkanji.ParseDictionary(response.Body, true)
		defer response.Body.Close()
		log.Printf("len %d", dictionary.Size())
		log.Printf("Taken %v", time.Since(now))
	}()

}
Exemple #2
0
func main() {
	js.AddRoute("/", mainPage)
	js.RouterRun()
}
Exemple #3
0
func main() {
	js.AddRoute(paths.main, mainPage)
	js.AddRoute(paths.second, secondPage)
	js.RouterRun()
}