# flowcontrol
    - for
        - for i := 0; i < 10; i++ {
        - for ; sum < 1000; {
        - For is Go's "while" - for sum < 1000 {
        - Forever - for {
    - if
        - if x < 0 {
        - } else {
        - if v := math.Pow(x, n); v < lim {
    - switch
        - switch os := runtime.GOOS; os {
        - A case body breaks automatically
        - fallthrough
    - defer
        - A defer statement defers the execution of a function until the surrounding function returns.
        - defer fmt.Println("world")
        - Deferred function calls are pushed onto a stack(LIFO)

# moretypes
    - Pointers - var p *int
    - Structs
        - type Vertex struct {
        - v := Vertex{1, 2}
    - Arrays
        - var a [10]int
        - primes := [6]int{2, 3, 5, 7, 11, 13}
    - Slices
        - var s []int = primes[1:4]
        - A slice does not store any data, it just describes a section of an underlying array.
        - q := []int{2, 3, 5, 7, 11, 13}
        - var a [10]int -> a[0:10] == a[:10] == a[0:] == a[:]
        - printSlice fmt.Printf("len=%d cap=%d %v\n", len(s), cap(s), s)
        - The zero value of a slice is nil.
        - a := make([]int, 5)  // len(a)=5 || b := make([]int, 0, 5) // len(b)=0, cap(b)=5
        - Slices of slices - board := [][]string{
        - for i, v := range pow { || for i := range pow { || for _, value := range pow {
    - Maps
        - m[key] = elem
        - elem = m[key]
        - delete(m, key)
        - elem, ok = m[key]
    - Function values
        - hypot := func(x, y float64) float64 {
        - return func(x int) int {

后端程序员之路 52、A Tour of Go-2的更多相关文章

  1. 后端程序员之路 53、A Tour of Go-3

    #method    - Methods        - Go does not have classes. However, you can define methods on types.    ...

  2. 后端程序员之路 51、A Tour of Go-1

    # A Tour of Go    - go get golang.org/x/tour/gotour    - https://tour.golang.org/    # welcome    - ...

  3. 后端程序员之路 59、go uiprogress

    gosuri/uiprogress: A go library to render progress bars in terminal applicationshttps://github.com/g ...

  4. 后端程序员之路 43、Redis list

    Redis数据类型之LIST类型 - Web程序猿 - 博客频道 - CSDN.NEThttp://blog.csdn.net/thinkercode/article/details/46565051 ...

  5. 后端程序员之路 22、RESTful API

    理解RESTful架构 - 阮一峰的网络日志http://www.ruanyifeng.com/blog/2011/09/restful.html RESTful API 设计指南 - 阮一峰的网络日 ...

  6. 后端程序员之路 16、信息熵 、决策树、ID3

    信息论的熵 - guisu,程序人生. 逆水行舟,不进则退. - 博客频道 - CSDN.NEThttp://blog.csdn.net/hguisu/article/details/27305435 ...

  7. 后端程序员之路 7、Zookeeper

    Zookeeper是hadoop的一个子项目,提供分布式应用程序协调服务. Apache ZooKeeper - Homehttps://zookeeper.apache.org/ zookeeper ...

  8. 后端程序员之路 4、一种monitor的做法

    record_t包含_sum._count._time_stamp._max._min最基础的一条记录,可以用来记录最大值.最小值.计数.总和metric_t含有RECORD_NUM(6)份recor ...

  9. 后端程序员之路 58、go wlog

    daviddengcn/go-colortext: Change the color of console text.https://github.com/daviddengcn/go-colorte ...

随机推荐

  1. Azure Functions(一)什么是 ServerLess

    一,引言 自去年4月份分享过3篇关于 Azure Functions 的文章之后,就一直没有再将 Azure Functions 相关的内容了.今天再次开始将 Azure Functions 相关的课 ...

  2. A - A Supermarket (贪心, 并查集)

    超市里有n个产品要卖,每个产品都有一个截至时间dx(从开始卖时算起),只有在这个截至时间之前才能卖出并且获得率润dy. 有多个产品,所有可以有不同的卖出顺序,每卖一个产品要占用1个单位的时间,问最多能 ...

  3. [ICPC 2018 宁夏邀请赛] A-Maximum Element In A Stack(思维)

    >传送门< 前言 辣鸡网络赛,虽然我是个菜鸡,然而好几个队伍十几分钟就AK???我心态那会彻底崩了,后来群里炸了,话题直接上知乎热搜,都是2018ICPC宁夏网络赛原题,这怎么玩,拼手速? ...

  4. CF-559C Gerald and Giant Chess(计数DP)

    给定一个 \(H*W\)的棋盘,棋盘上只有\(N\) 个格子是黑色的,其他格子都是白色的. 在棋盘左上角有一个卒,每一步可以向右或者向下移动一格,并且不能移动到黑色格子中.求这个卒从左上角移动到右下角 ...

  5. P4570 [BJWC2011]元素 (线性基)

    题意:n个石头 每个石头有a,b两个属性 要求选出一些石头使得没有一个子集的a属性xor和为0 且b属性和最大 题解:线性基例题了.. 好像需要理解一些性质 1.原序列里任一数都可有由线性基xor得到 ...

  6. 【noi 2.2_7891】一元三次方程求解(二分枚举+输出程序运行时间)

    对于noi上的题有2种解法: 1.数据很小(N=100),可以直接打for循环枚举和判断. 2.不会"三分",便用二分.利用"两根相差>=1"和 f(x1 ...

  7. Equal Numbers Gym - 101612E 思维

    题意: 给你n个数vi,你有k次操作.每一次操作你可以从n个数里面挑一个数,然后使得这个数乘于一个正整数.操作完之后,这n个数里面不同数的数量就是权值.你要使得这个值尽可能小. 题解: 如果a%b== ...

  8. Shell 信号处理 & Expect 免交互

    监控脚本项目 信号处理 1 什么是信号 由键盘组合键或者 kill 命令发出操作称之为信号 信号是发送给进程的,进程在收到信号后会作出默认的响应 2 为何要在进程内处理信号 进程在收到信号后会有默认的 ...

  9. markdown table collapse span

    markdown table collapse span refs xgqfrms 2012-2020 www.cnblogs.com 发布文章使用:只允许注册用户才可以访问! 原创文章,版权所有️x ...

  10. short URL 短网址实现原理剖析

    short URL 短网址实现原理剖析 意义,简短便于分享,避免出现超长 URL 的字符长度限制问题 原理分析, 使用 HashMap 存储对应的映射关系 (长度不超过7的字符串,由大小写字母加数字共 ...