Go 101 (Golang 101) v1.21.0Value Literals §7. Constants and Variables - also introduces untyped values and type deductions. §8. Common Operators - also introduces more type deduction rules. §9. Function Declarations and Calls package 4| 5| const MaxRnd = 16 // a named constant declaration 6| 7| // A function declaration 8| /* 9| StatRandomNumbers produces a certain number of 10 | non-negative random integers which are literal. The values involved in an operator operation are called operands. Please read common operators (§8) for more information. More operators will be introduced in other articles later. At line 36 and line0 码力 | 880 页 | 833.34 KB | 1 年前3
Go 101 (Golang 101) v1.21.0Value Literals §7. Constants and Variables - also introduces untyped values and type deductions. §8. Common Operators - also introduces more type deduction rules. §9. Function Declarations and Calls 9r0k, Streppel, wieghx, SourceLink, Oleh, Ibrahim Mohammed, shu-ming, Genaro- §1. Acknowledgments 8 Chris, Ying-Han Chen, Sina-Ghaderi, Kaijie Chen, huydang284, Soule Bah, Alex Pashkov, Dai Jie, Souhail package 4| 5| const MaxRnd = 16 // a named constant declaration 6| 7| // A function declaration 8| /* 9| StatRandomNumbers produces a certain number of 10| non-negative random integers which are0 码力 | 630 页 | 3.77 MB | 1 年前3
Golang Manual By AstaXie-20120522parentheses in their syntax. Also, the operator precedence hierarchy is shorter and clearer, so x<<8 + y<<16 means what the spacing implies. Commentary Go provides C-style /* */ block comments and C++-style strings, the range does more work for you, breaking out individual Unicode characters by parsing the UTF-8. Erroneous encodings consume one byte and produce the replacement rune U+FFFD. The loop for pos, char int { "UTC": 0*60*60, "EST": -5*60*60, "CST": -6*60*60, "MST": -7*60*60, "PST": -8*60*60, } Assigning and fetching map values looks syntactically just like doing the same for arrays0 码力 | 6205 页 | 12.83 MB | 1 年前3
Golang 101(Go语言101 中文版) v1.21.a如何编译和运行Go程序 Go编程入门 第4章:程序源代码基本元素介绍 第5章:关键字和标识符 第6章:基本类型和它们的字面量表示 第7章:常量和变量 - 顺便介绍了类型不确定值和类型推断 第8章:运算操作符 - 顺便介绍了更多的类型推断规则 第9章:函数声明和调用 第10章:代码包和包引入 第11章:表达式、语句和简单语句 第12章:基本流程控制语法 第13章:协程、延迟函数调用、以及恐慌和恢复 指定当前源文件所在的包名 2| 3| import "math/rand" // 引入一个标准库包 4| 5| const MaxRand = 16 // 声明一个具名整型常量 6| 7| // 一个函数声明 8| /* 9| StatRandomNumbers生成一些不大于MaxRand的非负 10 | 随机整数,并统计和返回小于和大于MaxRand/2的随机数 11 | 个数。输入参数numRands指定了要生成的随机数的总数。 行的等于比较符==,还有第20和36行的加法运算符+。 第35行中的+不是一个 运算符,它是一个字符串字面量中的一个字符。 一个使用操作符的操作中涉 及到的值称为操作值(有时也可称为运算数)。 请阅读常用操作符(第8章) 以获取更多关于操作符的信息。 更多操作符将在后续其它文章中介绍。 第35和36行调用了两个内置函数print和println。 从第13行到第26行声明的 函数StatRandomNumbers在第33行被调用。0 码力 | 821 页 | 956.82 KB | 1 年前3
Golang 101(Go语言101 中文版) v1.21.a- 如何编译和运行Go程序 Go编程入门 第4章:程序源代码基本元素介绍 第5章:关键字和标识符 第6章:基本类型和它们的字面量表示 第7章:常量和变量 - 顺便介绍了类型不确定值和类型推断 第8章:运算操作符 - 顺便介绍了更多的类型推断规则 第9章:函数声明和调用 第10章:代码包和包引入 第11章:表达式、语句和简单语句 第12章:基本流程控制语法 第13章:协程、延迟函数调用、以及恐慌和恢复 org网站不断增容和维护的动力。 赞赏 (请搜索关注微信公众号“Go 101”或者访问github.com/golang101/golang101获 取本书最新版) 第2章:Go语言简介 8 Go语言简介 Go是一门编译型的和静态的编程语言。 Go诞生于谷歌研究院。 Go的核心设计成员 中包括很多有着数十年编程语言研究领域经验的研究者。 Go有很多特性,有一些是独特的,有一些借鉴于一些其它编程语言: 3| import "math/rand" // 引入一个标准库包 4| 5| const MaxRand = 16 // 声明一个具名整型常量 6| 7| // 一个函数声明 8| /* 9| StatRandomNumbers生成一些不大于MaxRand的非负 10| 随机整数,并统计和返回小于和大于MaxRand/2的随机数 11| 个数。输入参数numRands指定了要生成的随机数的总数。0 码力 | 591 页 | 21.40 MB | 1 年前3
Go 入门指南(The way to Go)第7章:数组与切片 7.1 声明和初始化 7.2 切片 7.3 For-range 结构 7.4 切片重组(reslice) 7.5 切片的复制与追加 7.6 字符串、数组和切片的应用 第8章:Map 8.1 声明、初始化和 make 8.2 测试键值对是否存在及删除元素 8.3 for-range 的配套用法 8.4 map 类型的切片 8.5 map 的排序 8.6 将 map @zhanming themorecolor @everyx @chidouhu @spawnris 《Go入门指南》 翻译进度 支持本书 交流社区 新人守则 致谢 阅前必读 - 8 - 本文档使用 书栈(BookStack.CN) 构建 @domainname @leisore @dake @glight2000 @songleo 除特别声明外,本书中的内容使用 CC 乐 趣 前言 - 11 - 本文档使用 书栈(BookStack.CN) 构建 (第 3 章)。 在本书的第二部分,我们将会带领你贯穿 Go 语言的核心思想,譬如简单与复杂类型(第 4、7、8 章),控制结构 (第 5 章),函数(第 6 章),结构与方法(第 10 章)和接口(第 11 章)。我们会对 Go 语言的函数式和面 向对象编程进行透彻的讲解,包括如何使用 Go 语言来构造大型项目(第0 码力 | 466 页 | 4.44 MB | 1 年前3
Go 101 (Golang 101) v1.21.0Their Value Literals §7. Constants and Variables - also introduces untyped values and type deductions. §8. Common Operators - also introduces more type deduction rules. §9. Function Declarations and Calls §10 package 4. 5. const MaxRnd = 16 // a named constant declaration 6. 7. // A function declaration 8. /* 9. StatRandomNumbers produces a certain number of 10. non-negative random integers which are literal. The values involved in an operator operation are called operands. Please read common operators (§8) for more information. More operators will be introduced in other articles later. At line 36 and line0 码力 | 610 页 | 945.17 KB | 1 年前3
基于 mesos 的容器调度框架2017/8/3 基于 mesos 的容器调度框架 http://go-talks.appspot.com/github.com/huangnauh/slides/upone.slide#3 1/36 基于 mesos 的容器调度框架 Gopher 杭州 meetup 5 August 2017 黄励博(huangnauh) 又拍云 2017/8/3 基于 mesos 的容器调度框架 http://go-talks http://go-talks.appspot.com/github.com/huangnauh/slides/upone.slide#3 2/36 What's Upone 2017/8/3 基于 mesos 的容器调度框架 http://go-talks.appspot.com/github.com/huangnauh/slides/upone.slide#3 3/36 Mesos 介绍 credit: mesos.apache.org (http://mesos.apache.org/) 官方称之为分布式系统内核, 它把数据中心的 CPU、内存、磁盘等抽象成一个资源池 2017/8/3 基于 mesos 的容器调度框架 http://go-talks.appspot.com/github.com/huangnauh/slides/upone.slide#3 4/36 Mesos0 码力 | 36 页 | 2.49 MB | 1 年前3
Golang 101(Go语言101 中文版) v1.21.a如何编译和运行Go程序 Go编程入门 第4章:程序源代码基本元素介绍 第5章:关键字和标识符 第6章:基本类型和它们的字面量表示 第7章:常量和变量 - 顺便介绍了类型不确定值和类型推断 第8章:运算操作符 - 顺便介绍了更多的类型推断规则 第9章:函数声明和调用 第10章:代码包和包引入 第11章:表达式、语句和简单语句 第12章:基本流程控制语法 第13章:协程、延迟函数调用、以及恐慌和恢复 3. import "math/rand" // 引入一个标准库包 4. 5. const MaxRand = 16 // 声明一个具名整型常量 6. 7. // 一个函数声明 8. /* 9. StatRandomNumbers生成一些不大于MaxRand的非负 10. 随机整数,并统计和返回小于和大于MaxRand/2的随机数 11. 个数。输入参数numRands指定了要生成的随机数的总数。 的等于比较符==,还有第20和36行的加法运算符+。 第35行中的+不是一个运算 符,它是一个字符串字面量中的一个字符。 一个使用操作符的操作中涉及到的 值称为操作值(有时也可称为运算数)。 请阅读常用操作符(第8章)以获取 更多关于操作符的信息。 更多操作符将在后续其它文章中介绍。 第35和36行调用了两个内置函数print和println。 从第13行到第26行声明的函 数StatRandomNumbers在第33行被调用。0 码力 | 608 页 | 1.08 MB | 1 年前3
Optimization for number of goroutines using feedback controlFind Goroutines Chan Chan Search Match pt Print … 8-32 goroutines (NumCPU*2-8) Linux, 4CPU, GOMAXPROCS=4 Performance tuning in case of pt �8 Find Goroutines Chan Chan Search Match pt Print goroutines(NumCPU*2) macOS, 8CPU, GOMAXPROCS=8 Performance tuning in case of pt �9 Find Goroutines Chan Chan Search Match pt Print … Real-time virus scan process macOS, 8CPU, GOMAXPROCS=8 ❌ 4 goroutines(NumCPU/2) 0xc0000307d8 shed.sp 0xc0000307e0 stktopsp Stack (2048bytes) stktop Stack Stackguard 0 4523985 Sched (type gobuf) type gobuf struct { sp uintptr // 824633919448 -> 0xc0000307d8 pc0 码力 | 66 页 | 13.04 MB | 1 年前3
共 87 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9













