-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module unit.nginx.org/go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,8 @@ | ||
import os | ||
import subprocess | ||
from unit.applications.lang.go import TestApplicationGo | ||
|
||
|
||
def check_go(current_dir, temp_dir, test_dir): | ||
if not os.path.exists(temp_dir + '/go'): | ||
os.mkdir(temp_dir + '/go') | ||
def check_go(): | ||
process = TestApplicationGo.prepare_env('empty') | ||
|
||
env = os.environ.copy() | ||
env['GOPATH'] = current_dir + '/build/go' | ||
env['GO111MODULE'] = 'auto' | ||
|
||
try: | ||
process = subprocess.run( | ||
[ | ||
'go', | ||
'build', | ||
'-o', | ||
temp_dir + '/go/app', | ||
test_dir + '/go/empty/app.go', | ||
], | ||
env=env, | ||
stderr=subprocess.STDOUT, | ||
stdout=subprocess.PIPE, | ||
) | ||
|
||
if process.returncode == 0: | ||
return True | ||
|
||
except KeyboardInterrupt: | ||
raise | ||
|
||
except subprocess.CalledProcessError: | ||
return None | ||
if process != None and process.returncode == 0: | ||
return True |