简体   繁体   中英

error when trying to install go oracle driver(go get gopkg.in/goracle.v2)

When i executed this command (go get gopkg.in/goracle.v2) in windows command prompt, got this error.

..\..\go\src\gopkg.in\goracle.v2\conn.go:52:17: could not determine kind of name for C.dpiConn
..\..\go\src\gopkg.in\goracle.v2\conn.go:347:49: could not determine kind of name for C.dpiData
..\..\go\src\gopkg.in\goracle.v2\conn.go:342:20: could not determine kind of name for C.dpiNativeTypeNum
..\..\go\src\gopkg.in\goracle.v2\conn.go:341:21: could not determine kind of name for C.dpiObjectType
..\..\go\src\gopkg.in\goracle.v2\conn.go:343:20: could not determine kind of name for C.dpiOracleTypeNum
..\..\go\src\gopkg.in\goracle.v2\conn.go:747:19: could not determine kind of name for C.dpiShutdownMode
..\..\go\src\gopkg.in\goracle.v2\conn.go:724:18: could not determine kind of name for C.dpiStartupMode
..\..\go\src\gopkg.in\goracle.v2\conn.go:303:15: could not determine kind of name for C.dpiStmt
..\..\go\src\gopkg.in\goracle.v2\conn.go:347:37: could not determine kind of name for C.dpiVar
..\..\go\src\gopkg.in\goracle.v2\conn.go:395:9: could not determine kind of name for C.dpiVersionInfo
..\..\go\src\gopkg.in\goracle.v2\conn.go:351:13: could not determine kind of name for C.int
..\..\go\src\gopkg.in\goracle.v2\conn.go:304:47: could not determine kind of name for C.uint32_t```

The package is archived and it's advised to use the github.com/godror/godror [ Reference ]

To change everything using sed command, but as you're using Windows please do an equivalent thing:

Commands (using sed )

sed -i -e 's,goracle "gopkg.in/goracle.v2",godror "github.com/godror/godror",g; s,gopkg.in/goracle.v2,github.com/godror/godror,g; s/"goracle"/"godror"/g; s/goracle[.]/godror./g' $(find . -type f -name '*.go')

sed -i -e '/goracle.v2/d' go.mod

But in simpler terms I'd say as gopkg.in/goracle.v2 is now archived, try go get github.com/godror/godror .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM