# 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. Codeforces Round #589 (Div. 2) D. Complete Tripartite(模拟)

    题意:给你n个点 和 m条边 问是否可以分成三个集合 使得任意两个集合之间的任意两个点都有边 思路:对于其中一个集合v1 我们考虑其中的点1 假设点u和1无边 那么我们可以得到 u一定和点1在一个集合 ...

  2. HDU4787 GRE Words Revenge【AC自动机 分块】

    HDU4787 GRE Words Revenge 题意: \(N\)次操作,每次记录一个\(01\)串或者查询一个\(01\)串能匹配多少个记录的串,强制在线 题解: 在线的AC自动机,利用分块来降 ...

  3. 灯光照射,圆形探测类问题(解题报告)<分层差分><cmath取整>

    题目描述 一个n*n的网格图上有m个探测器,每个探测器有个探测半径r,问这n*n个点中有多少个点能被探测到. 输入输出格式 输入格式: (1<=r<n<=5000) (1<=m ...

  4. 【noi 2.2_1751】分解因数(递归)

    题意:问一个给定正整数的分解因数的方式数.N=a1*a2*...*ak(a1<=a2<=...<=ak). 解法:一步步分解该数,总方式数为一个个因数被分解的方案数之和. 可用大括号 ...

  5. 牛客编程巅峰赛S1第5场 - 青铜&白银 C.排队 (优先队列,归并排序)

    题意:有\(m\)个窗口,\(n\)个人排队,每个人都有各自的办理时间,只有办理完成窗口才能空出来,后面的人开始办理,求有多少人比后面的人开始办理的早但完成的晚. 题解:我们可以用优先队列来模拟办理, ...

  6. 牛客编程巅峰赛S1第3场 - 青铜&白银 A.位数求和

    题意:求所有\(n\)位数每位之和等于\(m\)的数的和. 题解:数据范围非常小,我们可以直接暴力枚举\(t\)到\(10*t\)的所有数字,逐位分解判断即可. 代码: class Solution ...

  7. 表达式目录树插件xLiAd.SqlEx.Core

    表达式目录树使用时 引用xLiAd.SqlEx.Core ,是一个很好的插件 using xLiAd.SqlEx.Core.Helper; Expression<Func<Reported ...

  8. 找工作面试题记录与参考资料(Golang/C++/计算机网络/操作系统/算法等)

    记录下去年(2020年)找工作的面试题及参考资料. C++ 智能指针的实现原理 多态的实现原理[2] C++11/14/17新特性[3] 手写memcpy和memmove[4] 介绍下boost库 计 ...

  9. [整理] LRU 算法的实现方式

    目录 概念 方法选择 实现方案(基于LinkedHashMap) 改进方案 1.LRU-K 2.Two queue 3.Multi Queue(MQ) LRU类算法对比 LRU 在 Redis 中的应 ...

  10. woj1018(HDU4384)KING KONG 循环群

    title: woj1018(HDU4384)KING KONG 循环群 date: 2020-03-19 09:43:00 categories: [acm] tags: [acm,woj,数学] ...