本文整理汇总了Golang中debug/gosym.Sym类的典型用法代码### 示例。如果您正苦于以下问题:Golang Sym类的具体用法?Golang Sym怎么用?Golang Sym使用的例子?那么恭喜您, 这里精选的类代码### 示例或许可以为您提供帮助。

在下文中一共展示了Sym类的3个代码### 示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码### 示例。

示例1: fieldRepr

func fieldRepr(s *gosym.Sym, typ reflect.Type, values []string, _html bool) (string, bool) {
    name := s.BaseName()
    repr := valRepr(s, typ, values, _html)
    if repr == "" {
        return "", false
    }
    return fmt.Sprintf("%s %s %s", name, typ, repr), true
}

开发者ID:rainycape,项目名称:gondola,代码行数:8,代码来源:repr.go

示例2: Match

func (spec *FuncLocationSpec) Match(sym *gosym.Sym) bool {
    if spec.BaseName != sym.BaseName() {
        return false
    }

    recv := stripReceiverDecoration(sym.ReceiverName())
    if spec.ReceiverName != "" && spec.ReceiverName != recv {
        return false
    }
    if spec.PackageName != "" {
        if spec.AbsolutePackage {
            if spec.PackageName != sym.PackageName() {
                return false
            }
        } else {
            if !partialPathMatch(spec.PackageName, sym.PackageName()) {
                return false
            }
        }
    }
    if spec.PackageOrReceiverName != "" && !partialPathMatch(spec.PackageOrReceiverName, sym.PackageName()) && spec.PackageOrReceiverName != recv {
        return false
    }
    return true
}

开发者ID:vornet,项目名称:delve,代码行数:25,代码来源:locations.go

示例3: Match

func (spec *FuncLocationSpec) Match(sym *gosym.Sym) bool {
    if spec.BaseName != sym.BaseName() {
        return false
    }

    recv := stripReceiverDecoration(sym.ReceiverName())
    if spec.ReceiverName != "" && spec.ReceiverName != recv {
        return false
    }
    if spec.PackageName != "" && spec.PackageName != sym.PackageName() {
        return false
    }
    if spec.PackageOrReceiverName != "" && spec.PackageOrReceiverName != sym.PackageName() && spec.PackageOrReceiverName != recv {
        return false
    }
    return true
}

开发者ID:jonboulle,项目名称:delve,代码行数:17,代码来源:locations.go

最后编辑: kuteng  文档更新时间: 2021-08-23 19:14   作者:kuteng