mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 12:05:52 +00:00
Use the proper logic when disabling the go module version
Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch>
This commit is contained in:
parent
1e1fc91d15
commit
75dd9d61ff
1 changed files with 1 additions and 1 deletions
|
@ -502,7 +502,7 @@ func RootPath(root string) (string, error) {
|
||||||
// GoVersion returns parsed version of Go mod version and fallback to runtime version if not found.
|
// GoVersion returns parsed version of Go mod version and fallback to runtime version if not found.
|
||||||
func GoVersion() (int, int, int) {
|
func GoVersion() (int, int, int) {
|
||||||
_, ok := os.LookupEnv(noGoModVersion)
|
_, ok := os.LookupEnv(noGoModVersion)
|
||||||
if ok {
|
if !ok {
|
||||||
if goModVersion, err := goModVersion(); err == nil {
|
if goModVersion, err := goModVersion(); err == nil {
|
||||||
return parseGoVersion(goModVersion)
|
return parseGoVersion(goModVersion)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue