本文整理汇总了Golang中kythe/io/kythe/go/services/xrefs.Service.CrossReferences方法的典型用法代码示例。如果您正苦于以下问题:Golang Service.CrossReferences方法的具体用法?Golang Service.CrossReferences怎么用?Golang Service.CrossReferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kythe/io/kythe/go/services/xrefs.Service
的用法示例。
在下文中一共展示了Service.CrossReferences方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
req.ReferenceKind = xpb.CrossReferencesRequest_ALL_REFERENCES
case "none":
req.ReferenceKind = xpb.CrossReferencesRequest_NO_REFERENCES
default:
return fmt.Errorf("unknown reference kind: %q", refKind)
}
switch docKind {
case "all":
req.DocumentationKind = xpb.CrossReferencesRequest_ALL_DOCUMENTATION
case "none":
req.DocumentationKind = xpb.CrossReferencesRequest_NO_DOCUMENTATION
default:
return fmt.Errorf("unknown documentation kind: %q", docKind)
}
logRequest(req)
reply, err := xs.CrossReferences(ctx, req)
if err != nil {
return err
}
if reply.NextPageToken != "" {
defer log.Printf("Next page token: %s", reply.NextPageToken)
}
return displayXRefs(reply)
})
cmdNode = newCommand("node", "[--filters factFilter1,factFilter2,...] [--max_fact_size] <ticket>",
"Retrieve a node's facts",
func(flag *flag.FlagSet) {
flag.StringVar(&nodeFilters, "filters", "", "Comma-separated list of node fact filters (default returns all)")
flag.IntVar(&factSizeThreshold, "max_fact_size", 64,
"Maximum size of fact values to display. Facts with byte lengths longer than this value will only have their fact names displayed.")