@@ -92,14 +92,6 @@ func getEnvGoSemVer() string {
9292 return "v" + goVersion [2 :]
9393}
9494
95- func tryBuild (buildFile , cmd string , args ... string ) bool {
96- if util .FileExists (buildFile ) {
97- log .Printf ("%s found, running %s\n " , buildFile , cmd )
98- return util .RunCmd (exec .Command (cmd , args ... ))
99- }
100- return false
101- }
102-
10395// Returns the import path of the package being built, or "" if it cannot be determined.
10496func getImportPath () (importpath string ) {
10597 importpath = os .Getenv ("LGTM_INDEX_IMPORT_PATH" )
@@ -129,7 +121,7 @@ func getImportPath() (importpath string) {
129121// determined.
130122func getImportPathFromRepoURL (repourl string ) string {
131123 // check for scp-like URL as in "git@github.com:github/codeql-go.git"
132- shorturl := regexp .MustCompile (" ^([^@]+@)?([^:]+):([^/].*?)(\\ .git)?$" )
124+ shorturl := regexp .MustCompile (` ^([^@]+@)?([^:]+):([^/].*?)(\.git)?$` )
133125 m := shorturl .FindStringSubmatch (repourl )
134126 if m != nil {
135127 return m [2 ] + "/" + m [3 ]
@@ -153,7 +145,7 @@ func getImportPathFromRepoURL(repourl string) string {
153145 host := u .Hostname ()
154146 path := u .Path
155147 // strip off leading slashes and trailing `.git` if present
156- path = regexp .MustCompile (" ^/+|\\ .git$" ).ReplaceAllString (path , "" )
148+ path = regexp .MustCompile (` ^/+|\.git$` ).ReplaceAllString (path , "" )
157149 return host + "/" + path
158150}
159151
0 commit comments