Skip to content

Commit 801ea14

Browse files
author
Noboru Saito
committed
Do not crash even if the number of columns is different.
1 parent 0fec118 commit 801ea14

File tree

4 files changed

+32
-13
lines changed

4 files changed

+32
-13
lines changed

.travis.yml

+23-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
language: go
2-
32
os:
4-
- linux
5-
- osx
6-
3+
- linux
4+
- osx
75
go:
8-
- tip
9-
6+
- 1.8
107
before_install:
11-
- go get github.com/Masterminds/glide
12-
8+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -y ; sudo apt-get install -y libc6-dev-i386 binutils-mingw-w64-x86-64 gcc-mingw-w64-base gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 ; fi
9+
- go get github.com/Masterminds/glide
10+
- go get github.com/mitchellh/gox
1311
install:
14-
- glide install
15-
12+
- glide install
1613
script:
17-
- go test $(glide novendor)
14+
- go test $(glide novendor)
15+
before_deploy:
16+
- mkdir $TRAVIS_BUILD_DIR/dist
17+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/build.sh ; fi
18+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then go build ; fi
19+
- rm -f $TRAVIS_BUILD_DIR/dist/*.zip
20+
- for i in `ls $TRAVIS_BUILD_DIR/dist/`;do zip $TRAVIS_BUILD_DIR/dist/$i.zip $TRAVIS_BUILD_DIR/dist/$i/* ;done
21+
deploy:
22+
provider: releases
23+
api_key:
24+
secure: Ssa2Xkxq6EGS02PMwmLC7tN2+tE9729hICagJuA61sLQh5P50jIScdSlKT5WMrgJGaLSA8wfUCuzUiq2t4N+u8U0UDTu3HqEooli2fO59CCzpemU3NvN4iT5lp4eiXZZ7EJUGwEpNWeOPGmh3PxdcXalaRu88LfBoWIE0ChyC0cvZycSOruChhajiow2//3JLsbp/B/jktx/NIJmoOk1NYTpnRaASytm3a2xugGrtYTOaqTeCkB0s4eyy++SaOOoyEauL4cox+nTqQ98ehXVWBxC1Nqt3tlMi9Jg4fm9KjmwZtkWx/WyHhA2WtuMq/L1mYMpijUDEGXIr6DfK7KxAdVeYoaxmrccAmNTQs5eCMqt+2Ooh3EWSfRsWutsPbhcwon9mUBsgD2xrEeKK6ZfKbRx9h1oNsQ0NmLz9kflpXWNLCbDmMXmdO2pR3kwdsnZQvCQEpMqE+B3XmcmGPPUpUAfr1XbbkwNdAbqEctDFmxKt4fMF3AILFT/7VYEHhSYkBWPIthRHnBLWsOppc5scsxYHBKge29Q2JrQhMtjumzUOQ4trT6Pu/I/d7SZEhcAV63QmIMEN1GYDDQnGB347mrk8jiAGOH1ROk/CYO69DZ5+QD4/RcV0ymJsgPv2y89As9ze1MyZXvJsw8JS/9PrKS/GLBPOhU7KYU+HqmZDo4=
25+
file_glob: true
26+
file: "$TRAVIS_BUILD_DIR/dist/*.zip"
27+
on:
28+
repo: noborus/trdsql
29+
tags: true

database.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (db *DDB) csvImport(reader *csv.Reader, header []string, head bool) error {
7676
return fmt.Errorf("ERROR Read: %s", err)
7777
}
7878
}
79-
for i := range header {
79+
for i := 0; len(list) > i && len(record) > i; i++ {
8080
list[i] = record[i]
8181
}
8282
rowImport(db.stmt, list)

scripts/build.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /bin/sh
2+
3+
TARGET="dist/trdsql_{{.OS}}_{{.Arch}}/{{.Dir}}"
4+
gox -cgo -os "linux" -arch "386 amd64" -output ${TARGET}
5+
6+
CC=x86_64-w64-mingw32-gcc gox -cgo -os "windows" -arch "amd64" -output ${TARGET}
7+
CC=i686-w64-mingw32-gcc gox -cgo -os "windows" -arch "386" -output ${TARGET}

trdsql.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"strings"
1212
)
1313

14-
const VERSION = `0.2.1`
14+
const VERSION = `0.3.0`
1515

1616
var debug = debugT(false)
1717

0 commit comments

Comments
 (0)