(sf *ast.SourceFile, node *ast.Node)
| 367 | } |
| 368 | |
| 369 | func nodeSourceText(sf *ast.SourceFile, node *ast.Node) string { |
| 370 | if sf == nil || node == nil { |
| 371 | return "" |
| 372 | } |
| 373 | text := sf.Text() |
| 374 | pos := scanner.GetTokenPosOfNode(node, sf, false) |
| 375 | end := node.End() |
| 376 | if pos < 0 || end < pos || end > len(text) { |
| 377 | return "" |
| 378 | } |
| 379 | return text[pos:end] |
| 380 | } |
no outgoing calls
no test coverage detected