You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xushiwei edited this page Aug 2, 2021
·
1 revision
There are two ways to import a Go package in Go+ programs.
The first way is importing it directly, as a Go+ package (but this way is not implemented currently). The reason it works is because a Go package is also a legal Go+ package. It is very easy, but has some limits. It doesn't work if the Go package to be imported uses cgo.
The second way is static link it into the gop command (In alpha stage, we use the qgo, qrun commands).
cd$GoPlusRoot
qexp <goPkgPathToImport>cd lib/default.go
vim lib/default.go
# add github.com/goplus/gop/lib/<goPkgPathToImport> and save
go install -v ./...