diff --git a/logdb_test.go b/logdb_test.go index cd26119..fb3c0d5 100644 --- a/logdb_test.go +++ b/logdb_test.go @@ -39,13 +39,13 @@ func TestSelect(t *testing.T) { logdb := NewLogDB("logdb.yaml") logdb.Connect() t.Error(logdb) - rows := logdb.Select("select * from log_spider limit 10;") + rows := logdb.Select("select uid, spider_id, device, platform, response from log_spider limit 10;") log.Println(rows) var l []ADStore for rows.Next() { ad := ADStore{} - rows.Scan(&ad) + rows.Scan(&ad.uid, &ad.spider_id, &ad.device, &ad.platform, &ad.response) l = append(l, ad) } log.Println(len(l))