mirror of
https://github.com/github/codeql.git
synced 2026-07-08 04:55:32 +02:00
Move subst package into go/extractor/util
This commit is contained in:
committed by
GitHub
parent
1870a01df5
commit
af2ccd199f
@@ -19,7 +19,6 @@ go_library(
|
||||
"//go/extractor/dbscheme",
|
||||
"//go/extractor/diagnostics",
|
||||
"//go/extractor/srcarchive",
|
||||
"//go/extractor/subst",
|
||||
"//go/extractor/toolchain",
|
||||
"//go/extractor/trap",
|
||||
"//go/extractor/util",
|
||||
|
||||
@@ -25,7 +25,6 @@ import (
|
||||
"github.com/github/codeql-go/extractor/dbscheme"
|
||||
"github.com/github/codeql-go/extractor/diagnostics"
|
||||
"github.com/github/codeql-go/extractor/srcarchive"
|
||||
"github.com/github/codeql-go/extractor/subst"
|
||||
"github.com/github/codeql-go/extractor/toolchain"
|
||||
"github.com/github/codeql-go/extractor/trap"
|
||||
"github.com/github/codeql-go/extractor/util"
|
||||
@@ -767,7 +766,7 @@ func normalizedPath(ast *ast.File, fset *token.FileSet) string {
|
||||
if err != nil {
|
||||
path = file
|
||||
}
|
||||
return subst.ResolvePath(path)
|
||||
return util.ResolvePath(path)
|
||||
}
|
||||
|
||||
// extractFile extracts AST information for the given file
|
||||
|
||||
18
go/extractor/subst/BUILD.bazel
generated
18
go/extractor/subst/BUILD.bazel
generated
@@ -1,18 +0,0 @@
|
||||
load("@rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "subst",
|
||||
srcs = [
|
||||
"subst.go",
|
||||
"subst_other.go",
|
||||
"subst_windows.go",
|
||||
],
|
||||
importpath = "github.com/github/codeql-go/extractor/subst",
|
||||
visibility = ["//go:__subpackages__"],
|
||||
deps = select({
|
||||
"@rules_go//go/platform:windows": [
|
||||
"@org_golang_x_sys//windows",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
10
go/extractor/util/BUILD.bazel
generated
10
go/extractor/util/BUILD.bazel
generated
@@ -9,11 +9,19 @@ go_library(
|
||||
"logging.go",
|
||||
"overlays.go",
|
||||
"semver.go",
|
||||
"subst.go",
|
||||
"subst_other.go",
|
||||
"subst_windows.go",
|
||||
"util.go",
|
||||
],
|
||||
importpath = "github.com/github/codeql-go/extractor/util",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["@org_golang_x_mod//semver"],
|
||||
deps = ["@org_golang_x_mod//semver"] + select({
|
||||
"@rules_go//go/platform:windows": [
|
||||
"@org_golang_x_sys//windows",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
|
||||
go_test(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package subst
|
||||
package util
|
||||
|
||||
// ResolvePath resolves subst'd drive letters in a full path.
|
||||
// If the path starts with a subst'd drive letter, replaces it with the backing path.
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build !windows
|
||||
|
||||
package subst
|
||||
package util
|
||||
|
||||
// ResolveDrive is a no-op on non-Windows platforms.
|
||||
func ResolveDrive(driveRoot string) string { return "" }
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build windows
|
||||
|
||||
package subst
|
||||
package util
|
||||
|
||||
import (
|
||||
"os"
|
||||
Reference in New Issue
Block a user