Go 指南
Go 指南包、变量、函数
helloworld.go
1234567package mainimport "fmt"func main() { fmt.Println("Hello, world")}
packages.go
每个 Go 程序都是由包构成的。
程序从 main 包开始运行。
本程序通过导入路径 "fmt" 和 "math/rand" 来使用这两个包。
按照约定,包名与导入路径的最后一个元素一致。例如,"math/rand" 包中的源码均以 package rand 语句开始。
注意: 此程序的运行环境是固定的,因此 rand.Intn 总是会返回相同的数字。
(要得到不同的数字,需为生成器提供不同的种子数,参见 rand.Seed。 练习场中的时间为常量,因此你需要用其它的值作为种子数。)
12345678910package mainimport ( "fmt" "math/rand")func ma ...
yum自动下载的安装包
/var/cache/yum
if 判断
if 判断12345678if <条件判断1>: <执行1>elif <条件判断2>: <执行2>elif <条件判断3>: <执行3>else: <执行4>
elif 是else if 的简写,理论上可以有多个elif 。
if 语句是由上而下进行判断的,在遇见True 之后,判断就会中止,不再进行之后的判断。
示例如下:
1234567891011zhang=1if zhang==0: print('0')elif zhang==2: print('2')elif zhang==3: print('3')elif zhang==1: print('1')else: print('13')
123[python@fushisanlang liaoxuefeng_note]$ python3 test.py 1[python@fushisanlang liaoxuefe ...
redhat7 yum源
redhat7 yum源[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost ~]# sed -i ‘s/$releasever/7/g’ /etc/yum.repos.d/CentOS-Base.repo
[root@localhost ~]# yum clean all
[root@localhost ~]# yum list
nginx配置文件发布以及汉字显示异常
nginx配置文件发布以及汉字显示异常
nginx配置文件发布
1234autoindex_exact_size off;autoindex_localtime on;autoindex on;
nginx配置文件发布汉字显示异常
12default_type 'text/html';charset utf-8;