go basic, golang basic
go basic, golang basic The Go Programming Language, Go 语言虽然是静态编译型语言, 但是它却拥有脚本化的语法, 支持多种编程范式(函数式和面向对象)。 Go 是 Google 开发的一种静态强类型、编译型、并发型, 并具有垃圾回收功能的编程语言。 罗伯特·格瑞史莫, 罗勃·派克及肯·汤普逊于 2007年9月开始设计 Go, 稍后 Ian Lance Taylor, Russ Cox 加入项目。 Go 是基于 Inferno 操作系统所开发的。 Go 语言是静态类型的编程语言 go source code https://github.com/golang/go version latest: 1.23.0 current: 1.17.7 install # macos brew search golang brew upgrade golang hello world package main import "fmt" func main() { fmt.Println("hello world") } go run hello-world.go go build hello-world.go ./hello-world 升级依赖包版本, upgrade package version go list -m all|grep redis # go list 返回: github.com/redis/go-redis/v9 v9.0.2 # 升级 go-redis 版本 go get -u github.com/redis/go-redis/v9 # -u The -u flag instructs get to update modules providing dependencies of packages named on the command line # to use newer minor or patch releases when available. # 不带 -u 的 go get 在发现依赖包已经存在的时候不会更新, 加 -u 参数会检查依赖包是否有更新然后下载新版本. # 升级 go-redis 到 9.0.4 go get -u github.com/redis/go-redis/v9@v9.0.4 -u 更新包,包括他们的依赖项 -v 输出详细信息 http://studygolang.com/articles/1941 ...