当前位置:网站首页>You have a string of code, but do not support the lower version of go; Judge the go version number, you deserve it!
You have a string of code, but do not support the lower version of go; Judge the go version number, you deserve it!
2022-06-23 08:17:00 【Deng_ Xian_ Sheng】
I don't say much nonsense
Show You Code!
// copyright 2022 article author .
// The use of this source code is restricted by CC 4.0 BY-SA Constraints of style license , The license can be found in the article header .
version := runtime.Version()
reg := regexp.MustCompile(`(\d.*\.\d.*\.\d.*)`)
if reg == nil {
log.Panicln(" Regular expression parsing failed ")
}
versionStr := reg.FindAllStringSubmatch(version, -1)
versionSlice := strings.Split(versionStr[0][1], ".")
var intSlice []int
for _, v := range versionSlice {
atoi, err := strconv.Atoi(v)
if err != nil {
log.Panicln("strconv error ")
}
intSlice = append(intSlice, atoi)
}
if !(intSlice[0] >= 1 && intSlice[1] >= 18) {
return
}
fmt.Println("happy")
边栏推荐
- C# scrollView 向上滚动还是向下滚动
- PCB电路板特性检查项目都有哪些?
- Rotary table visual screening machine and its image recognition system
- 记一次高校学生账户的“从无到有”
- Pyspark on HPC (Continued): reasonable partition processing and consolidated output of a single file
- Does huangrong really exist?
- How to start Jupiter notebook in CONDA virtual environment
- Fillet the tabbar with the flutter
- 生产环境服务器环境搭建+项目发布流程
- Lightweight UI control library worth collecting
猜你喜欢

QT irregular shape antialiasing

实战监听Eureka client的缓存更新

数据资产为王,解析企业数字化转型与数据资产管理的关系

船长阿布的灵魂拷问

Implementation of AVL tree

复选框的基本使用与实现全选和反选功能

Check the file through the port

建立一有序的顺序表,并实现下列操作: 1.把元素x插入表中并保持有序; 2.查找值为x的元素,若找到将其删除; 3.输出表中各元素的值。

How to start Jupiter notebook in CONDA virtual environment

After reading five books, I summarized these theories of wealth freedom
随机推荐
3-ProgressBar和二次裁剪
Regular expression use cases
transform的结构及用法
C Scrollview scroll up or scroll down
6-闪耀的激光-CALayer 的应用
Deep learning ----- convolution (conv2d) bottom layer
正则表达式使用案例
Pyspark on HPC (Continued): reasonable partition processing and consolidated output of a single file
2-用线段构成图形、坐标转换
力扣(LeetCode)173. 二叉搜索树迭代器(2022.06.22)
How to mine keywords and improve user experience before website construction?
Rotary table visual screening machine and its image recognition system
The essence of five good books on wealth and freedom
How to solve the problem that flv video stream cannot be played and TS file generation fails due to packet loss?
Commonly used bypass methods for SQL injection -ctf
十多年前的入职第一天
[cross border e-commerce solutions] lighthouse will be used for pure IP expansion of new business - continuous efforts!
C RichTextBox controls the maximum number of rows
[paper notes] catching both gray and black swans: open set supervised analog detection*
Implementation of AVL tree