上一页 1 2 3 4 5 6 ··· 16 下一页
摘要: 1. 数组 go中的数组需要提前定义好长度 初始化 1 var course [3]string course[0] = "go" course[1] = "grpc" course[2] = "gin" 初始化 2 course := [3]string{"go", "grpc", "gin"} 阅读全文
posted @ 2023-03-09 22:22 ForLivetoLearn 阅读(17) 评论(0) 推荐(0) 编辑
摘要: if条件判断 if age > 18 { } else if age == 18 { } else { } switch语句 score := 80 switch score { case 60, 70, 80: fmt.Println("一般") case 90, 100: fmt.Println 阅读全文
posted @ 2023-03-09 16:40 ForLivetoLearn 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 字符串常用方法都在strings包中 高性能字符串拼接 var builder strings.Builder builder.WriteString("用户名") builder.WriteByte(97) str := builder.String() fmt.Println(str) 包含字符 阅读全文
posted @ 2023-03-09 15:40 ForLivetoLearn 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 通常使用 str := fmt.Sprintf("%d", a) fmt.Printf("%s", str) 缺省格式和类型 | 格式化后效果 | 格式 | 描述 | | | | | | [0 1] | %v | 缺省格式 | | []int64{0, 1} | %#v | go语言打印 | | [ 阅读全文
posted @ 2023-03-09 14:13 ForLivetoLearn 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 1. 算数运算符 如: + - * / ... 2. 关系运算符 == != > < >= <= 3. 逻辑运算符 | 运算符 | 含义 | | | | | && | 与运算。如果两个操作数都⾮零,则条件变为真 | | || | 或运算。如果任何两个操作数是⾮零,则条件变为真 | | ! | ⾮运算 阅读全文
posted @ 2023-03-09 13:08 ForLivetoLearn 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1. bool类型 布尔型的值只可以是常量 true 或者 false。 var b bool = true 2. 数值型 1. 整数型 int8 有符号 8 位整型 (-128 到 127) ⻓度:8bit int16 有符号 16 位整型 (-32768 到 32767) int32 有符号 3 阅读全文
posted @ 2023-03-08 16:41 ForLivetoLearn 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1. 变量定义 变量必须先定义后使用 变量必须有类型 变量定义后不能改变类型 变量定义后必须使用 var ( name string = "goland" age int = 18 ) // 简洁定义,有冒号,不能用于全局定义 name := "goland" age := 18 // 没有冒号 v 阅读全文
posted @ 2023-03-08 14:34 ForLivetoLearn 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 实时同步还可以使用inotify+rsync命令,但是不太方便https://www.cnblogs.com/forlive/p/10769895.html sersync还可以实现开机自启动 配置rsync守护进程 安装rsync yum install rsync 修改rsync配置文件/etc 阅读全文
posted @ 2022-12-27 11:53 ForLivetoLearn 阅读(126) 评论(0) 推荐(0) 编辑
摘要: # 导入画图函数 import matplotlib.pyplot as plt # 创建画布, figsize:指定图的长宽, dpi:图像的清晰度,返回fig对象 plt.figure(figsize=(20, 8), dpi=100) # 创建X,Y坐标轴数据 x = [1,2,3,4,5] 阅读全文
posted @ 2022-12-21 16:14 ForLivetoLearn 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 安装字体 安装字体程序 yum -y install cups-libs fontconfig ttmkfdir 创建中文字体目录 mkdir /usr/share/fonts/chinese chmod -R 755 /usr/share/fonts/chinese 在windows中查找字体,上 阅读全文
posted @ 2022-12-21 15:50 ForLivetoLearn 阅读(50) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 16 下一页