mirror of
https://github.com/go-delve/delve.git
synced 2025-10-27 20:23:41 +08:00
tests: fix tests on Go 1.23 (#3697)
* Adjust rtype.go script to handle constants moved to internal/abi from runtime * Remove tests in service/dap/server_test that relied on knowledge of the internal layout of channels.
This commit is contained in:
committed by
GitHub
parent
d7f104bf9c
commit
2e88b7ead3
@ -619,7 +619,7 @@ func check() {
|
||||
for _, C := range Cs {
|
||||
rules := checkConstValRules[C]
|
||||
pos := fset.Position(rules[0].pos)
|
||||
def := lookupPackage(pkgmap, "runtime").Types.Scope().Lookup(C)
|
||||
def := findConst(pkgmap, C)
|
||||
if def == nil {
|
||||
fmt.Fprintf(os.Stderr, "%s:%d: could not find constant %s\n", pos.Filename, pos.Line, C)
|
||||
allok = false
|
||||
@ -655,6 +655,21 @@ func fieldTypeByName(typ *types.Struct, name string) types.Type {
|
||||
return nil
|
||||
}
|
||||
|
||||
func findConst(pkgmap map[string]*packages.Package, Cs string) types.Object {
|
||||
for _, C := range strings.Split(Cs, "|") {
|
||||
pkg := lookupPackage(pkgmap, "runtime")
|
||||
if dot := strings.Index(C, "."); dot >= 0 {
|
||||
pkg = lookupPackage(pkgmap, C[:dot])
|
||||
C = C[dot+1:]
|
||||
}
|
||||
def := pkg.Types.Scope().Lookup(C)
|
||||
if def != nil {
|
||||
return def
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func matchType(typ types.Type, T string) bool {
|
||||
if T == "anytype" {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user