Skip to content

Commit

Permalink
pkg/cover: export cleanPath
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangenj committed Jul 8, 2024
1 parent 765643d commit 0e85f12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cover/backend/dwarf.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func makeDWARFUnsafe(params *dwarfParams) (*Impl, error) {
continue // drop the unit
}
// TODO: objDir won't work for out-of-tree modules.
unit.Name, unit.Path = cleanPath(unit.Name, objDir, srcDir, buildDir, splitBuildDelimiters)
unit.Name, unit.Path = CleanPath(unit.Name, objDir, srcDir, buildDir, splitBuildDelimiters)
allUnits[nunit] = unit
nunit++
}
Expand Down Expand Up @@ -455,7 +455,7 @@ func symbolizeModule(target *targets.Target, interner *symbolizer.Interner, objD
err0 = res.err
}
for _, frame := range res.frames {
name, path := cleanPath(frame.File, objDir, srcDir, buildDir, splitBuildDelimiters)
name, path := CleanPath(frame.File, objDir, srcDir, buildDir, splitBuildDelimiters)
frames = append(frames, Frame{
Module: mod,
PC: frame.PC + mod.Addr,
Expand Down Expand Up @@ -583,7 +583,7 @@ func cleanPathAndroid(path, srcDir string, delimiters []string, existFn func(str
return "", ""
}

func cleanPath(path, objDir, srcDir, buildDir string, splitBuildDelimiters []string) (string, string) {
func CleanPath(path, objDir, srcDir, buildDir string, splitBuildDelimiters []string) (string, string) {
filename := ""

path = filepath.Clean(path)
Expand Down

0 comments on commit 0e85f12

Please sign in to comment.