Commit 15371c0d authored by gwenn's avatar gwenn

Trim tail.

parent 492aec2b
language: go language: go
sudo: false
go: go:
- 1.4 - 1.4
- tip - tip
before_install: addons:
- echo "yes" | sudo add-apt-repository ppa:travis-ci/sqlite3 apt:
- sudo apt-get update -qq sources:
- sudo apt-get install -qq libsqlite3-dev - debian-sid
packages:
- libsqlite3-dev
install: install:
- go get github.com/gwenn/yacr - go get github.com/gwenn/yacr
- go get -tags all github.com/gwenn/gosqlite - go get -tags all github.com/gwenn/gosqlite
......
...@@ -7,6 +7,7 @@ package sqlite_test ...@@ -7,6 +7,7 @@ package sqlite_test
import ( import (
"strings" "strings"
"testing" "testing"
. "github.com/gwenn/gosqlite" . "github.com/gwenn/gosqlite"
) )
......
...@@ -36,6 +36,7 @@ import ( ...@@ -36,6 +36,7 @@ import (
"fmt" "fmt"
"math" "math"
"reflect" "reflect"
"strings"
"time" "time"
"unsafe" "unsafe"
) )
...@@ -109,7 +110,7 @@ func (c *Conn) prepare(sql string, args ...interface{}) (*Stmt, error) { ...@@ -109,7 +110,7 @@ func (c *Conn) prepare(sql string, args ...interface{}) (*Stmt, error) {
if tail != nil && *tail != '\000' { if tail != nil && *tail != '\000' {
t = C.GoString(tail) t = C.GoString(tail)
} }
s := &Stmt{c: c, stmt: stmt, tail: t, columnCount: -1, bindParameterCount: -1} s := &Stmt{c: c, stmt: stmt, tail: strings.TrimSpace(t), columnCount: -1, bindParameterCount: -1}
if len(args) > 0 { if len(args) > 0 {
err := s.Bind(args...) err := s.Bind(args...)
if err != nil { if err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment