diff --git a/.appveyor.yml b/.appveyor.yml index 9aa59af0b..a2bab0050 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -90,6 +90,7 @@ for: - sh: "nvm install ${nodejs_version}" - sh: "npm install npm@7.24.2 -g" - sh: "npm -v" + - sh: "go version" - sh: "echo $PATH" - sh: "java --version" diff --git a/aws_lambda_builders/workflows/go_modules/validator.py b/aws_lambda_builders/workflows/go_modules/validator.py index 1e0949be0..c83f95d43 100644 --- a/aws_lambda_builders/workflows/go_modules/validator.py +++ b/aws_lambda_builders/workflows/go_modules/validator.py @@ -52,15 +52,14 @@ def validate(self, runtime_path): runtime_path = super(GoRuntimeValidator, self).validate(runtime_path) - expected_major_version = int(self.runtime.replace(self.LANGUAGE, "").split(".")[0]) - min_expected_minor_version = 11 if expected_major_version == 1 else 0 - p = subprocess.Popen([runtime_path, "version"], cwd=os.getcwd(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) version_string, _ = p.communicate() if p.returncode == 0: major_version, minor_version = GoRuntimeValidator.get_go_versions(version_string.decode()) - if major_version == expected_major_version and minor_version >= min_expected_minor_version: + min_expected_major_version = 1 + min_expected_minor_version = 11 if major_version == 1 else 0 + if major_version >= min_expected_major_version and minor_version >= min_expected_minor_version: self._valid_runtime_path = runtime_path return self._valid_runtime_path