Beispiel #1
0
func onetask() context.Context {
	l := list.New()
	l.PushBack("task one")

	ctx := context.WithValue(context.Background(), "tasks", l)
	ctx = context.WithValue(ctx, "logger", log.New(os.Stdout, "testing: ", log.LstdFlags))
	return ctx
}
Beispiel #2
0
func notasks() context.Context {
	ctx := context.WithValue(context.Background(), "tasks", list.New())
	ctx = context.WithValue(ctx, "logger", log.New(os.Stdout, "testing: ", log.LstdFlags))
	return ctx
}
Beispiel #3
0
func init() {
	taskctx = context.WithValue(taskctx, "tasks", list.New())
	taskctx = context.WithValue(taskctx, "logger", log.New(os.Stdout, "taskd: ", log.LstdFlags))
	http.Handle("/", handlers.CompressHandler(handlers.LoggingHandler(os.Stdout, router())))
}