package easyquotation import ( "easyquotation/sina" "easyquotation/stock" "fmt" "github.com/gocolly/colly" "testing" "time" ) func TestInit(t *testing.T) { Init() c := colly.NewCollector() SinaStock_spider := sina.NewSinaStock(c) SinaStock_spider.Start("") tt := time.NewTicker(time.Second * 2) for { select { case <- tt.C: currentTime := time.Now() timeFormatted := currentTime.Format("2006-01-02 15:04:05") fmt.Println("Current time:", timeFormatted) fmt.Println(stock.G_STOCK_MANAGER.StockList["sz002215"]) fmt.Println(stock.G_STOCK_MANAGER.StockList["sh000001"]) } } }