go mod does not include the non-go code in the vendor directory.
Currently we are using go with go-oracle to connect to the database. We are planning on using docker so went with the idea of using go modules to version-ize our project. But since go-oracle has sub folders which have C code, it does not get copied over from the mod directory that go creates in the pkg folder. Is there a way we could add the non go code as well? We did try to use https://github.com/goware/modvendor but it did not copy the non-go code. Unless we did not use it correctly.
package main
import (
"fmt"
"github.com/jmoiron/sqlx"
log "github.com/sirupsen/logrus"
goracle "gopkg.in/goracle.v2"
)
const connectionString = "some connection string"
func main() {
fmt.Print("Inside main")
db, err := sqlx.Connect("goracle", connectionString)
if err != nil {
log.Infof("Could not connect %v%", err)
} else {
db.Query("select 1 from dual")
}
fmt.Println(goracle.DriverName)
}
go mod init go mod vendor
You will see that the code will not compile.