随笔分类 -  Golang

go语言
摘要:一、前言 go相比于java的maven管理包资源,golang也有属于自己的mod文件。用于管理第三方依赖文件。接下来就是学习如何使用mod文件,来管理go项目的第三方资源。 二、配置 在项目中创建mod文件例如 接着需要对golang工具进行设置 在设置代理链接 在环境变量还要加入GO111MO 阅读全文
posted @ 2021-07-23 22:43 Auler 阅读(211) 评论(0) 推荐(0) 编辑
摘要:一、环境 centos:7.x go: 1.15.5 二、项目编译 windows命令行执行 D:\golangProject> SET CGO_ENABLED=0 D:\golangProject> SET GOOS=linux D:\golangProject> SET GOARCH=amd64 阅读全文
posted @ 2021-02-03 16:49 Auler 阅读(203) 评论(0) 推荐(0) 编辑
摘要:一、报错 github.com/aaa/yyy: github.com/aaa/yyy@v1.14.6: parsing go.mod: module declares its path as: github.com/xxx/yyy but was required as: github.com/a 阅读全文
posted @ 2021-01-30 15:55 Auler 阅读(920) 评论(0) 推荐(0) 编辑
摘要:一、定义 B树B-tree,B-树其实就是B树,英文名balanced tree。一棵m阶B树(balanced tree of order m)是一棵平衡的m路搜索树。它或者是空树,或者是满足下列性质的树: 1、根结点至少有两个子女; 2、每个非根节点所包含的关键字个数 j 满足:┌m/2┐ - 阅读全文
posted @ 2020-12-21 21:00 Auler 阅读(974) 评论(0) 推荐(0) 编辑
摘要:一、接口 type Car interface { //定义一个Car的接口 what() //定义一个方法 } type Bicycle struct { } type Motor struct { } func (bicycle Bicycle) what() { fmt.Println("I 阅读全文
posted @ 2020-12-02 18:52 Auler 阅读(121) 评论(0) 推荐(0) 编辑
摘要:一、切片Slice func main() { fmt.Println("Hello, World!") s := []int{1, 2, 3} //数组 printSlice(s) fmt.Println(s[0:2]) //使用切片方式 fmt.Println(s[:2]) fmt.Printl 阅读全文
posted @ 2020-12-02 13:27 Auler 阅读(97) 评论(0) 推荐(0) 编辑
摘要:一、数组 package main import "fmt" //全局变量 var g int = 10 //声明一个函数类型 type cb func(int) int func main() { fmt.Println("Hello, World!") var arr [5]int //一维数组 阅读全文
posted @ 2020-12-01 19:59 Auler 阅读(117) 评论(0) 推荐(0) 编辑
摘要:一、常量 const a int = 123 //常量定义const,显式 //a = 456 //修改常量值,会报错 Cannot assign to a,无法赋值 const b = 23 //隐式 const c,d = 1,"s" //多重赋值 const e,f int = 6,7 //多 阅读全文
posted @ 2020-12-01 17:38 Auler 阅读(67) 评论(0) 推荐(0) 编辑
摘要:一、语言结构 //这个package是包声明(类似声明变量)//mian是被声明的包名(取main是go程序是可独立执行程序!!!)//文件命名不需要一致,例如test.go文件含有package main也可以当作可独立执行程序 package main //fmt是这个程序引入的包,可以调用fm 阅读全文
posted @ 2020-11-30 22:38 Auler 阅读(88) 评论(0) 推荐(0) 编辑
摘要:Go!Go!Go!作为一名程序猿,跟着时代进步才是变强!大!~ 使用多年的java语言的我,对于其他c、c++、python、c#等都有所接触,怎么说呢,各有千秋在不同领域上都散发着光辉。em...... go语言在这么多老前辈都围观下,拔地而起,成为专为微服务打造的语言(前面都是道听途说,作为go 阅读全文
posted @ 2020-11-23 22:37 Auler 阅读(86) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示