上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 31 下一页
摘要: 1、使用var关键字申明,指定数组的长度 package main import "fmt" func main() { var a [5]int fmt.Println(a) //默认是零值[0 0 0 0 0] var b [5]string fmt.Println(b) //默认是零值[] v 阅读全文
posted @ 2022-06-12 11:32 南风丶轻语 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 1、一般用法 以func关键字申明,传入参数名称写在前,参数类型写在后 返回可以申明返回值名称,也可以不申明,申明返回值时返回类型写在后,申明返回值,相当于定义了一个变量,来接返回值(一般不建议使用,毕竟函数体一大就不是很清晰能看到那里赋值了) 返回可以返回多个值 不接收某个返回值,用下划线_代替就 阅读全文
posted @ 2022-06-12 10:37 南风丶轻语 阅读(36) 评论(0) 推荐(0) 编辑
摘要: Go条件语句的基本使用 1、一般使用 package main import "fmt" func main() { s := 0 for i := 1; i <= 100; i++ { s += i } fmt.Println(s) } 2、省略起始条件 package main import ( 阅读全文
posted @ 2022-06-11 20:38 南风丶轻语 阅读(32) 评论(0) 推荐(0) 编辑
摘要: Go语言Switch的用法 1、等值匹配 package main import "fmt" func f(a, b int, op string) int { switch op { case "+": return a + b case "-": return a - b case "*": r 阅读全文
posted @ 2022-06-11 20:12 南风丶轻语 阅读(78) 评论(0) 推荐(0) 编辑
摘要: Go语言的安装 1、下载地址 https://studygolang.com/dl Windows系统下载msi文件(例如https://golang.google.cn/dl/go1.18.3.windows-386.msi),然后安装就直接下一步,下一步就行 Linux系统下载tar.gz文件( 阅读全文
posted @ 2022-06-11 19:11 南风丶轻语 阅读(368) 评论(0) 推荐(0) 编辑
摘要: Go定义常量和枚举类型 1、使用const定义常量 package main func main() { const a = 1 //使用const定义常量 const b, c = "b", "c" //使用const定义常量 const filename = "a.txt" //使用const定 阅读全文
posted @ 2022-06-11 16:11 南风丶轻语 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Centos镜像国内下载地址参考 CentOS 官方下载地址 https://www.centos.org/download/ Centos国内下载源 http://mirrors.cn99.com/centos/7/isos/x86_64/ http://mirrors.sohu.com/cent 阅读全文
posted @ 2022-06-11 10:50 南风丶轻语 阅读(1495) 评论(0) 推荐(0) 编辑
摘要: centos虚拟机无法被宿主机访问web服务 1、现象 在虚拟机中可以访问自己的web服务,IP是192.168.40.129 在宿主机却不可以 2、解决办法 2.1、关闭防火墙即可 sudo systemctl stop firewalld 关于防火墙开关可参考 https://www.cnblo 阅读全文
posted @ 2022-05-31 17:46 南风丶轻语 阅读(344) 评论(0) 推荐(0) 编辑
摘要: centos安装python39(其他版本也是一样的流程) 1、下载python39 可以去官网下载,也可以去华为云下载 华为云: https://mirrors.huaweicloud.com/python/3.9.0/ 我下载的是python3.9.0 https://mirrors.huawe 阅读全文
posted @ 2022-05-31 15:15 南风丶轻语 阅读(720) 评论(0) 推荐(0) 编辑
摘要: npm install 报错提示github需要权限 Permission denied (publickey) 1、报错信息 npm ERR! code 128 npm ERR! An unknown git error occurred npm ERR! command git no repla 阅读全文
posted @ 2022-05-31 15:15 南风丶轻语 阅读(2738) 评论(0) 推荐(1) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 31 下一页