上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 86 下一页
摘要: 阅读全文
posted @ 2020-05-22 22:40 富坚老贼 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-05-22 19:34 富坚老贼 阅读(116) 评论(0) 推荐(0) 编辑
摘要: go get github.com/tarm/goserial package main import ( "log" serial "github.com/tarm/goserial" ) func main() { //设置串口号和波特率 s := &serial.Config{Name: "c 阅读全文
posted @ 2020-05-22 15:45 富坚老贼 阅读(1643) 评论(0) 推荐(0) 编辑
摘要: 1.基础 接口命名一般在最后加 er package main //计算 type calculationer interface { work(i int, j int) int } //加法结构体 type add struct { } func (c add) work(i int, j in 阅读全文
posted @ 2020-05-20 22:48 富坚老贼 阅读(134) 评论(0) 推荐(0) 编辑
摘要: init的执行时机 导入包时前面加 _ 表示只执行包内的init函数 main包会编译成.exe 使用首字母大小写来说明包是否外部可见 阅读全文
posted @ 2020-05-20 22:45 富坚老贼 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 使用go mod 代理来安装 https://goproxy.io是一个国内的代理执行 go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.io,direct 重启vscode提示安装所有插件 阅读全文
posted @ 2020-05-20 09:23 富坚老贼 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 参数 func say(s:String){ print(s) } say(s: "hello") 参数默认值 unc say(age:Int=12){ print(age) } say() 参数标签 可变参数 unc say(_ num:Int...){ for i in num{ print(i 阅读全文
posted @ 2020-05-19 19:52 富坚老贼 阅读(126) 评论(0) 推荐(0) 编辑
摘要: for in while repeat{ }while if switch 阅读全文
posted @ 2020-05-19 19:21 富坚老贼 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 1.启动go module set GO111MODULE=on GO111MODULE=off 禁用模块支持,编译时会从GOPATH和vendor文件夹中查找包 GO111MODULE=on启用模块支持,编译时会忽略GOPATH和vendor文件夹,只根据 go.mod下载依赖 GO111MODU 阅读全文
posted @ 2020-05-19 13:44 富坚老贼 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 一、数组 初始化 var arr=["tom","liu","meng"] 插入 arr.insert("lucy",at: 2) 删除 arr.remove(at: 2) 二、集合 set 无序相同类型的集合 var s1=Set<Int>() s1=[2,3,4] // 或者 var s2 :S 阅读全文
posted @ 2020-05-17 12:44 富坚老贼 阅读(133) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 86 下一页