上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 44 下一页
摘要: package main import ( "fmt" ) func main() { //test_for() test_label() } func test_for() { str := "hello,world! 中国" for index, val := range str { fmt.P 阅读全文
posted @ 2022-04-30 16:52 ty1539 阅读(71) 评论(0) 推荐(0) 编辑
摘要: /* 函数也是一种类型 */ package main import ( "fmt" ) /* 自定义函数类型 接受两个int参数,返回int类型*/ type op_func func(int, int) int func main() { test_func() } func test_func 阅读全文
posted @ 2022-04-30 16:40 ty1539 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 栈: 先进后出, 子弹装入弹夹, 进入:压栈, 出去:出栈,弹出 函数就是栈内存, 效率高, 栈内存, 内存是在栈空间上分配的 大小 c语音的有1M, go语言有几百kb 堆: 先进先出 系统公用的一块内存, 效率没有栈高 大小 几十G 一个进程有多个线程, 线程空间就是在堆空间内分配,有加锁,解锁 阅读全文
posted @ 2022-04-30 15:29 ty1539 阅读(23) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" func calc(a , b int) (int,int){ sum := a+b sub := a-b return sum,sub } func calc1(a , b int) (sum int,sub int){ sum = a+b su 阅读全文
posted @ 2022-04-29 23:41 ty1539 阅读(27) 评论(0) 推荐(0) 编辑
摘要: package main import( "fmt" ) func justify(n int) bool{ if n <=1{ return false } for i:=2;i<n;i++{ if n %i == 0 { return false } } return true } func e 阅读全文
posted @ 2022-04-29 23:36 ty1539 阅读(20) 评论(0) 推荐(0) 编辑
摘要: chrome://flags/ 搜索栏输入: Tab Hover Card Images 改为enabled 重启浏览器, 就会标签预览功能 多线程下载: 输入: download 会出现 Parallel downloading,改为enabled 重启浏览器,如果下载的东西支持多线程下次,下次下 阅读全文
posted @ 2022-04-28 00:09 ty1539 阅读(372) 评论(0) 推荐(0) 编辑
摘要: func main(){ var chinese = "我是中国人, I am Chinese" fmt.Println("chinese length", len(chinese)) fmt.Println("chinese word length", len([]rune(chinese))) 阅读全文
posted @ 2022-04-27 21:26 ty1539 阅读(56) 评论(0) 推荐(0) 编辑
摘要: Day 10 http 编程 Go 原生支持 http, import "net/http" Go 的 http 服务性能和 nginx 比较接近 几行代码就可以实现一个 web 服务 简单的例子 package main import ( "fmt" "net/http" ) func Hello 阅读全文
posted @ 2022-04-26 22:49 ty1539 阅读(15) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" _ "github.com/go-sql-driver/mysql" "github.com/jmoiron/sqlx" ) var Db *sqlx.DB func init() { database, err := sqlx.Open("m 阅读全文
posted @ 2022-04-26 22:42 ty1539 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 计算机需要解决的最根本问题:如何代表数字晶体管是如何工作的: https://haokan.baidu.com/v?vid=16026741635006191272&pd=bjh&fr=bjhauthor&type=video lntel cpu的制作过程 htps:/haokan.baidu.co 阅读全文
posted @ 2022-04-25 23:20 ty1539 阅读(104) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 44 下一页