Я новичок в разработке go lang и пытаюсь подключить облачную oracle БД с сервера go (используя пакет 'github.com/godror/godror'). Я устанавливаю мгновенный клиент Oracle и также задаю путь к среде.
Go сервер работает и может установить sh соединение и запросы. Но когда я создаю производственное приложение, получаю эти ошибки.
Команда: env GOOS=linux GOARCH=amd64 go build -o odb db_main.go
../github.com/godror/godror/orahlp.go:452:53: undefined: VersionInfo
../github.com/godror/godror/orahlp.go:461:53: undefined: VersionInfo
../github.com/godror/godror/orahlp.go:479:19: undefined: VersionInfo
../github.com/godror/godror/orahlp.go:480:19: undefined: VersionInfo
../github.com/godror/godror/orahlp.go:481:30: undefined: ObjectType
../github.com/godror/godror/orahlp.go:482:31: undefined: Event
../github.com/godror/godror/orahlp.go:482:42: undefined: SubscriptionOption
../github.com/godror/godror/orahlp.go:482:64: undefined: Subscription
../github.com/godror/godror/orahlp.go:483:10: undefined: StartupMode
../github.com/godror/godror/orahlp.go:484:11: undefined: ShutdownMode
../github.com/godror/godror/orahlp.go:484:11: too many errors```
My server code(db_main.go)
```package main
import (
"database/sql"
"encoding/json"
"fmt"
"log"
"net/http"
"time"
_ "github.com/godror/godror"
)
// VersionInfo,ObjectType,Event,SubscriptionOption,Subscription,StartupMode,ShutdownMode
var db *sql.DB
func main() {
var err error
db, err = sql.Open("godror", "xyz/abc@13.43.11.8:1521/sampledb")
if err != nil {
log.Println("Error")
fmt.Println(err)
return
}
defer db.Close()
port := ":8000"
http.HandleFunc("/insert", InsertData)
http.HandleFunc("/list", GetList)
log.Println("Tranzo-Shahi Oracle DB running in ", port)
httpErr := http.ListenAndServe(port, nil)
if httpErr != nil {
log.Println("Tranzo-Shahi Oracle DB Error: ", httpErr.Error())
}
}