Ian Lance Taylor b76c61051f bind: pass &v[0] in direct call to C
In Go 1.6, the cgo checking rules are more precise when they see an
address operation as an argument to the C function.  When you pass &v[0]
to a C function, the cgo check just verifies that v itself does not
contain any pointers.  When you write `p := &v[0]` and then pass p to
the C function, the cgo check is conservative: it verifies that the
entire memory block to which p points does not contain any pointers.
When the bind function is called by code that passes a slice that is
part of a larger struct, this means that the cgo check will look at the
entire larger struct, not just the slice.  This can cause a surprising
run time failure.

Avoid this problem by rewriting the code slightly to pass &v[0] in the
call to the C function itself.

In particular this fixes the tests of github.com/jmoiron/sqlx when using
Go 1.6.
2016-01-29 12:39:47 -08:00
2015-09-16 10:47:42 +09:00
2015-11-02 11:53:42 +09:00
2014-11-14 17:20:14 +09:00
2014-11-14 00:23:32 +01:00
2015-09-16 15:58:07 +09:00
2015-01-26 18:38:13 +09:00
2014-08-18 17:00:59 +09:00
2014-08-18 16:52:12 +09:00
2016-01-28 20:28:43 -05:00
2015-08-20 03:02:59 +03:00
2015-06-12 13:26:42 +09:00
2015-11-03 13:52:28 +01:00
2015-12-30 00:19:24 +02:00
2015-06-12 13:26:42 +09:00
2015-06-12 13:26:42 +09:00

go-sqlite3

Build Status Coverage Status GoDoc

Description

sqlite3 driver conforming to the built-in database/sql interface

Installation

This package can be installed with the go get command:

go get github.com/mattn/go-sqlite3

go-sqlite3 is cgo package. If you want to build your app using go-sqlite3, you need gcc. However, if you install go-sqlite3 with go install github.com/mattn/go-sqlite3, you don't need gcc to build your app anymore.

Documentation

API documentation can be found here: http://godoc.org/github.com/mattn/go-sqlite3

Examples can be found under the ./_example directory

FAQ

License

MIT: http://mattn.mit-license.org/2012

sqlite3-binding.c, sqlite3-binding.h, sqlite3ext.h

The -binding suffix was added to avoid build failures under gccgo.

In this repository, those files are amalgamation code that copied from SQLite3. The license of those codes are depend on the license of SQLite3.

Author

Yasuhiro Matsumoto (a.k.a mattn)

Description
No description provided
Readme 50 MiB
Languages
C 96.2%
Go 3.4%
C++ 0.3%