当前位置:网站首页>Adhere to the foundation of 20 minutes go every day II
Adhere to the foundation of 20 minutes go every day II
2022-07-02 14:07:00 【Lizijian】
Variable
Every language needs to use variables , The declaration rules are also different
Similar rules : Understandable , Unified and standardized naming rules
go Can declare a , You can also declare multiple , Multiple times can be organized with brackets
var (
numberOne int
numberTwo int
numberThree string
)Operator
go Supported operators
- Arithmetic operator
- Logical operators
Arrays and slices
arr1 := [4]int{1,2,3}
slice1 := []int{1,2,3}
slice2 := slice1[1:2]Dictionaries
map1 := make(map[string]string)
map1["abc"] = "test"
if val,ok:= map1["a"];ok {
fmt.Println(val)
}else {
fmt.Println("error")
}Structure
type Location struct {
Addr string
}
type Person struct{
Name string
Age int
Location
}Interface
type DoIt interface{
Do()string
}library ( package ) management
Import package import
Import not used import _ "xxx"
Do not display library name import . "xxx"
Multiple package imports import( a, b, c)
Project organization structure
Domain model
- app
- domain
- infra
- main
- scheduler
- ui
- api-server
- api_server.go
- router_function.go
- parse
- parser.go
- api-server
Business iteration pattern
- cmd
- configs
- deploments
- docs
- initalizers
- logs
- pkg
- scripts
- src
- tools
- verndors
- main.go
- Makefile
边栏推荐
- Mysql5.7 installation super easy tutorial
- kaggle如何使用utility script
- ArrayList and LinkedList
- [document tree, setting] font becomes smaller
- Just 1000 fans, record it
- 默认插槽,具名插槽,作用域插槽
- Qt新建项目
- SystemServer进程
- Quantum three body problem: Landau fall
- The global special paper revenue in 2021 was about $27 million, and it is expected to reach $35 million in 2028. From 2022 to 2028, the CAGR was 3.8%
猜你喜欢

Memory management 01 - link script

rxjs Observable 自定义 Operator 的开发技巧

Téléchargement par navigateur

2022家用投影仪首选!当贝F5强悍音画效果带来极致视听体验

Error: eacces: permission denied, access to "/usr/lib/node_modules"

Codeforces Round #803 (Div. 2)(A~D)

Qt-制作一个简单的计算器-实现四则运算

Daily practice of C language --- monkeys divide peaches

浏览器驱动的下载

c# 水晶报表打印
随机推荐
Qt如何设置固定大小
P1042 [NOIP2003 普及组] 乒乓球
P1347 sorting (topology + SPFA judgment ring or topology [inner judgment ring])
每日学习3
693. Travel sequencing (map + topology)
Data consistency between redis and database
693. 行程排序(map + 拓扑)
你知道Oracle的数据文件大小有上限么?
Just 1000 fans, record it
mysql ---- Oracle中的rownum转换成MySQL
P1042 [noip2003 popularization group] Table Tennis
Development skills of rxjs observable custom operator
The global special paper revenue in 2021 was about $27 million, and it is expected to reach $35 million in 2028. From 2022 to 2028, the CAGR was 3.8%
Origin绘制热重TG和微分热重DTG曲线
Find love for speed in F1 delta time Grand Prix
每天坚持20分钟go的基础二
(POJ - 1984) navigation nightare (weighted and search set)
刚好1000粉丝,记录一下
石子合并板子【区间DP】(普通石子合并 & 环形石子合并)
Use of UIC in QT