Aagithub.com/mattn/go-sqlite3BAab
ABvendorgovendorgo version go1.12 linux/amd64
Bgo build main.go
 /usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
 /tmp/go-link-281256755/000029.o: In function `callbackTrampoline':
 /tmp/go-build/_cgo_export.c:25: multiple definition of `callbackTrampoline'
 /tmp/go-link-281256755/000005.o:/tmp/go-build/_cgo_export.c:25: first defined here
 /tmp/go-link-281256755/000029.o: In function `stepTrampoline':
 ...
 /home/xxx/go/src/gitlab.xxxxxxxxx.com/xxxxxxxxx-tools/A/vendor/github.com/mattn/go-sqlite3/sqlite3.go:129: multiple definition of `_sqlite3_result_text'
 /tmp/go-link-281256755/000009.o:/home/xxx/go/src/gitlab.xxxxxxxxx.com/xxxxxxxxx-tools/A/vendor/github.com/mattn/go-sqlite3/sqlite3.go:129: first defined here
 /tmp/go-link-281256755/000033.o: In function `_sqlite3_result_blob':
 ...
Avendorgovendor
 package main

 import (
   "database/sql"
   "fmt"

   "gitlab.xxxxxxxxx.com/xxxxxxxxxxxxxxx/A/a"

   _ "github.com/mattn/go-sqlite3"
 )

 func main() {
   fmt.Println(a.ModuleVariable) // use submodule `a` just like B is doing

   _, _ = sql.Open(`sqlite3`, `test.db`) // use sqlite too
 }
Asqlite3/tmp/go-link-281256755/000005.oBsqlite3

How to fix these situation? Is there any golang env settings to avoid these?


vendorAB~/go/src/github.com/mattn/go-sqlite3/A