-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from linfun486/main
go1.18以上版本通过go list -m -f xxx 方式会受go.work影响获取不到正确的文件路径 导致产生 exit stat…
- Loading branch information
Showing
4 changed files
with
38 additions
and
3 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
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,19 @@ | ||
// @Package: util | ||
// @Author: linfuchuan | ||
// @Date: 2024/7/4 20:40 | ||
|
||
package util | ||
|
||
import ( | ||
"github.com/hashicorp/go-version" | ||
"runtime" | ||
) | ||
|
||
// IsVersionGreaterThan118 | ||
// @Description: 是否运行时go版本大于1.18 | ||
// @return bool | ||
func IsVersionGreaterThan118() bool { | ||
version1_18, _ := version.NewVersion("1.18") | ||
v, _ := version.NewVersion(runtime.Version()[2:]) | ||
return v.GreaterThanOrEqual(version1_18) | ||
} |