mardi 30 octobre 2018

Golang Postgres Travis panic: pq: syntax error at or near "NOT"

I am getting an error I have not seen before when I am trying run my go tests through travis.yml

When running locally all my tests pass, however when run through Travis I get the following error a few times in my tests:

panic: pq: syntax error at or near "NOT"

I thought maybe it was because my pg database utilizes the following packages:

"github.com/jmoiron/sqlx"
"github.com/lib/pq"

But my Travis config should pick up on those imports? My travis.yml looks like the following:

language: go

go:
  - "1.10.4"
  - "1.10.3"
  - "1.10.1"

services:
  - postgresql

addons:
  postgresql: "10"
  apt:
    packages:
    - postgresql-10
    - postgresql-client-10
env:
  global:
  - PGPORT=5432

before_install:
  - sudo apt-get update
  - go get golang.org/x/tools/cmd/goimports
  - sudo /etc/init.d/postgresql stop
  - sudo /etc/init.d/postgresql start

before_script:
  - psql -c 'create database db1;' -U postgres
  - psql -c 'create database db2;' -U postgres

script:
  - go test ./... -parallel 2 -v

Aucun commentaire:

Enregistrer un commentaire