globalType: support typepatch
This commit is contained in:
@@ -58,7 +58,6 @@ type Once struct {
|
||||
}
|
||||
|
||||
func (o *Once) Do(f func()) {
|
||||
println("Once.Do start", o.done)
|
||||
if !o.done {
|
||||
o.m.Lock()
|
||||
defer o.m.Unlock()
|
||||
|
||||
@@ -60,6 +60,9 @@ const (
|
||||
)
|
||||
|
||||
func IsPatched(pkg *types.Package) bool {
|
||||
if pkg == nil {
|
||||
return false
|
||||
}
|
||||
p := (*typesPackage)(unsafe.Pointer(pkg))
|
||||
return *(*uint8)(unsafe.Pointer(&p.complete)) == tagPatched
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user