后端程序员之路 51、A Tour of Go-1
# A Tour of Go
- go get golang.org/x/tour/gotour
- https://tour.golang.org/
# welcome
- fmt.Println("The time is", time.Now())
# basic
- Packages && Imports
- package main
- import (\n "fmt"\n "math"\n)
- fmt.Println("My favorite number is", rand.Intn(10))
- fmt.Println(math.Pi)
- Functions
- func add(x int, y int) int {
- func add(x, y int) int {
- Multiple results - func swap(x, y string) (string, string) {
- Named return values - func split(sum int) (x, y int) {
- Variables
- var c, python, java bool
- var c, python, java = true, false, "no!"
- Short variable declarations - k := 3
- bool、string、int8 uint16 uintptr、byte(uint8)、rune(int32)、float32 float64、complex64 complex128
- Zero values
- Variables declared without an explicit initial value are given their zero value.
- 0 for numeric types
- false for the boolean type
- "" (the empty string) for strings
- Type conversions
- i := 42
- f := float64(i)
- u := uint(f)
- Constants
- const World = "世界"
- const ( ... )
后端程序员之路 51、A Tour of Go-1的更多相关文章
- 后端程序员之路 53、A Tour of Go-3
#method - Methods - Go does not have classes. However, you can define methods on types. ...
- 后端程序员之路 52、A Tour of Go-2
# flowcontrol - for - for i := 0; i < 10; i++ { - for ; sum < 1000; { ...
- 后端程序员之路 59、go uiprogress
gosuri/uiprogress: A go library to render progress bars in terminal applicationshttps://github.com/g ...
- 后端程序员之路 43、Redis list
Redis数据类型之LIST类型 - Web程序猿 - 博客频道 - CSDN.NEThttp://blog.csdn.net/thinkercode/article/details/46565051 ...
- 后端程序员之路 22、RESTful API
理解RESTful架构 - 阮一峰的网络日志http://www.ruanyifeng.com/blog/2011/09/restful.html RESTful API 设计指南 - 阮一峰的网络日 ...
- 后端程序员之路 16、信息熵 、决策树、ID3
信息论的熵 - guisu,程序人生. 逆水行舟,不进则退. - 博客频道 - CSDN.NEThttp://blog.csdn.net/hguisu/article/details/27305435 ...
- 后端程序员之路 7、Zookeeper
Zookeeper是hadoop的一个子项目,提供分布式应用程序协调服务. Apache ZooKeeper - Homehttps://zookeeper.apache.org/ zookeeper ...
- 后端程序员之路 4、一种monitor的做法
record_t包含_sum._count._time_stamp._max._min最基础的一条记录,可以用来记录最大值.最小值.计数.总和metric_t含有RECORD_NUM(6)份recor ...
- 后端程序员之路 58、go wlog
daviddengcn/go-colortext: Change the color of console text.https://github.com/daviddengcn/go-colorte ...
随机推荐
- LA 3641 Leonardo的笔记本 & UVA 11077 排列统计
LA 3641 Leonardo的笔记本 题目 给出26个大写字母的置换B,问是否存在要给置换A,使得 \(A^2 = B\) 分析 将A分解为几个循环,可以观察经过乘积运算得到\(A^2\)后,循环 ...
- HDU2065 "红色病毒"问题 【组合数学 二项式定理】
HDU2065 "红色病毒"问题 Description: 医学界发现的新病毒因其蔓延速度和Internet上传播的"红色病毒"不相上下,被称为"红色 ...
- hdu5432Rikka with Array (数位dp+十进制转化为二进制)
Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he ...
- Codeforces Round #693 (Div. 3) G. Moving to the Capital (图,dp)
题意:有一张有向图,每个点的权值为点\(1\)到该点的最短距离(每条边的长度为\(1\)),对于一条路径,这条路径上最多只能有一条边,这条边起点的权值不小于终点,现在要求每个点能到达路径上的点的最小权 ...
- 2020ICPC·小米 网络选拔赛第一场 A.Intelligent Warehouse (DP)
题意:给你一组数,选一些数出来组成一个排列,使得每个数都能被前一个数整除,求排列的最大元素. 题解:我们先用欧拉筛筛出\(1e7\)的质数,设\(dp[i]\)表示当前选的数都是\(i\)的约数且合法 ...
- Cobbler服务部署
1.安装epel源 yum -y install epel-release 2.安装cobbler环境所需的包 yum install -y httpd dhcp xinetd tftp cobble ...
- mybaits(七)spring整合mybaits
与 Spring 整合分析 http://www.mybatis.org/spring/zh/index.html 这里我们以传统的 Spring 为例,因为配置更直观,在 Spring 中使用配置类 ...
- SSL 数据加密原理简述
最近调试mqtt协议,为了保证数据安全性和将来客户端的对云的兼容性选择了openssl作为安全加密中间层,而没有使用私有的加密方式.所以花了点时间学习了一下ssl 加密流程整理如下: 因为正常正式使用 ...
- 手把手搭建一套私有 npm 服务
手把手搭建一套私有 npm 服务 gnpm xnpm pnpm lnpm refs xgqfrms 2012-2020 www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
- 微软官方 free 教程 & 教材 ,MVC ,ASP.NET,.NET,
MVA https://mva.microsoft.com/ebooks free ebooks 微软官方, free, 教程 ,教材,微软官方 free 教程 & 教材,MVC ,ASP.N ...