We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func TestMapScanWithRefMap2(t *testing.T) { session := createSession(t) defer session.Close() if err := createTable(session, `CREATE TABLE gocql_test.scan_map_ref_table ( testtext text PRIMARY KEY, testint int, )`); err != nil { t.Fatal("create table:", err) } m := make(map[string]interface{}) m["testtext"] = "testtext" m["testint"] = 100 if err := session.Query(`INSERT INTO scan_map_ref_table (testtext, testint) values (?,?)`, m["testtext"], m["testint"]).Exec(); err != nil { t.Fatal("insert:", err) } var testText string ret := map[string]interface{}{ "testtext": &testText, // testint is not set here. } iter := session.Query(`SELECT * FROM scan_map_ref_table`).Iter() if ok := iter.MapScan(ret); !ok { t.Fatal("select:", iter.Close()) } if ret["testtext"].(*string) != &testText { t.Fatal("returned testtext is not the same string") } iter = session.Query(`SELECT * FROM scan_map_ref_table`).Iter() if ok := iter.MapScan(ret); !ok { t.Fatal("select:", iter.Close()) } }
Ends up with:
=== RUN TestMapScanWithRefMap2 --- FAIL: TestMapScanWithRefMap2 (0.08s) panic: interface conversion: interface {} is string, not *string [recovered] panic: interface conversion: interface {} is string, not *string
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Ends up with:
The text was updated successfully, but these errors were encountered: