rename file.Location.VirtualPath to AccessPath (#2288)

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman
2023-11-09 11:30:08 -06:00
committed by GitHub
parent baa3dc74d3
commit 3f13d209a5
37 changed files with 320 additions and 320 deletions
@@ -636,7 +636,7 @@ func Test_directPackageFiles(t *testing.T) {
RealPath: "some-file",
FileSystemID: "",
},
VirtualPath: "some-file",
AccessPath: "some-file",
},
LocationMetadata: file.LocationMetadata{
Annotations: map[string]string{},
+2 -2
View File
@@ -111,8 +111,8 @@ func toPath(s source.Description, p pkg.Package) string {
if len(locations) > 0 {
location := locations[0]
packagePath := location.RealPath
if location.VirtualPath != "" {
packagePath = location.VirtualPath
if location.AccessPath != "" {
packagePath = location.AccessPath
}
packagePath = strings.TrimPrefix(packagePath, "/")
switch metadata := s.Metadata.(type) {
+1 -1
View File
@@ -123,7 +123,7 @@ FileCopyrightText: NOASSERTION
f = file.Location{
LocationData: file.LocationData{
Coordinates: c,
VirtualPath: "",
AccessPath: "",
},
LocationMetadata: file.LocationMetadata{},
}
+1 -1
View File
@@ -80,7 +80,7 @@ func Test_EncodeDecodeCycle(t *testing.T) {
}
for _, d := range deep.Equal(p, actualPackages[idx]) {
if strings.Contains(d, ".VirtualPath: ") {
if strings.Contains(d, ".AccessPath: ") {
// location.Virtual path is not exposed in the json output
continue
}