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
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
//$GOPATH/src/gotest/util/util.go
package util
import (
"github.com/go-xorm/xorm"
)
type Ctx struct{
DB *xorm.Engine
}
type MM struct{
Ctx
}
I write a util/util.go
//$GOPATH/src/gotest/util2/util2.go
package util2
import (
"gotest/util"
"github.com/go-xorm/xorm"
)
var a *xorm.Engine
type MX struct{
util.MM
}
func Doing(){
a := MX{}
a.DB.NewSession()
}
I write a util2/util2.go
go install -buildmode=shared -linkshared github.com/go-xorm/xorm
go install -buildmode=shared -linkshared gotest/util
go install -buildmode=shared -linkshared gotest/util2
//$GOPATH/src/gotest/util2/util2.go
package util2
import (
"gotest/util"
//"github.com/go-xorm/xorm"
)
//remove this line
//var a *xorm.Engine
type MX struct{
util.MM
}
func Doing(){
a := MX{}
a.DB.NewSession()
}
If i remove "var a *xorm.Engine"this line
it will complaint me
fish@iZ2820y71jjZ:~/Project/fishgo/pkg$ go install -buildmode=shared -linkshared gotest2/util2
# /tmp/go-build787415985/libgotest2-util2.so
gotest2/util2.Doing: github.com/go-xorm/xorm.(*Engine).NewSession: not defined
gotest2/util2.Doing: undefined: github.com/go-xorm/xorm.(*Engine).NewSession
But go install is ok,maybe shared mode can't handle nested struct import
Please answer these questions before submitting your issue. Thanks!
go version
)?go env
)?If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
I write a util/util.go
I write a util2/util2.go
And cmd/link crash!!
Crash StackTrace
NoCrash
Crash
The text was updated successfully, but these errors were encountered: