ImportPathStack 引入路径栈
()
| 307 | |
| 308 | // ImportPathStack 引入路径栈 |
| 309 | func (dep PomDependency) ImportPathStack() string { |
| 310 | var importPaths []string |
| 311 | paths := dep.ImportPath() |
| 312 | for i, d := range paths { |
| 313 | importPath := fmt.Sprintf("[%s]", d.Index4()) |
| 314 | if i > 0 { |
| 315 | pre := paths[i-1] |
| 316 | importPath += fmt.Sprintf("(line:%d-%d)", pre.Start, pre.End) |
| 317 | } |
| 318 | if d.RefProperty != nil { |
| 319 | if d.RefProperty.Define != nil { |
| 320 | importPath += fmt.Sprintf("#[%s](line:%d)", d.RefProperty.Define.Index4(), d.RefProperty.Start) |
| 321 | } |
| 322 | importPath += fmt.Sprintf("${%s}=%s", d.RefProperty.Key, d.RefProperty.Value) |
| 323 | } |
| 324 | importPaths = append(importPaths, importPath) |
| 325 | } |
| 326 | return strings.Join(importPaths, "<=") |
| 327 | } |
no test coverage detected