Skip to content

Commit 702c22b

Browse files
committed
Refactor calculation of inLGTM
1 parent f018695 commit 702c22b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

go/extractor/cli/go-autobuilder/go-autobuilder.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ func main() {
350350
log.Printf("Autobuilder was built with %s, environment has %s\n", runtime.Version(), getEnvGoVersion())
351351

352352
srcdir := os.Getenv("LGTM_SRC")
353-
inLGTM := srcdir != ""
354-
if inLGTM {
353+
if srcdir != "" {
355354
log.Printf("LGTM_SRC is %s\n", srcdir)
356355
} else {
357356
cwd, err := os.Getwd()
@@ -399,9 +398,7 @@ func main() {
399398
importpath := getImportPath()
400399
needGopath := getNeedGopath(depMode, importpath)
401400

402-
if os.Getenv("LGTM_INDEX_NEED_GOPATH") != "" {
403-
inLGTM = true
404-
}
401+
inLGTM := os.Getenv("LGTM_SRC") != "" || os.Getenv("LGTM_INDEX_NEED_GOPATH") != ""
405402

406403
if inLGTM && needGopath {
407404
// a temporary directory where everything is moved while the correct

0 commit comments

Comments
 (0)