项目目录
https://makeoptim.com/golang/standards/project-layout/
快速开始
基本
一些基本操作
println
package main
import "fmt"
func main(){
fmt.Println("go" + "lang")
fmt.Println("1+1 =", 1+1)
fmt.Println("7.0/3.0 =", 7.0/3.0)
fmt.Println(true && false)
fmt.Println(true || false)
fmt.Println(!true)
// 常量
const n = 10000
fmt.Println("常量:",n)
// 循环
strs := []string{"a","b","c"}
for i,v := range strs{
fmt.Println("index:",i,"val:",v)
}
// 死循环
for {
fmt.Println("loop")
break
}
// 切片
s = make([]string,3)
fmt.Println("emp:", s, "len:", len(s), "cap:", cap(s))
}
循环
// You can edit this code!
// Click here and start typing.
package main
import "fmt"
func main() {
list := []int{1,2,4}
for index,val :=range list{
fmt.Println("%s - %s",index,val)
}
}
ORM
框架
云原生
组件
微服务
框架
istio
需要k8s
go-zero
这个可以
go-micro
文档太少了