当前位置:网站首页>[go record] start go language from scratch -- make an oscilloscope with go language (I) go language foundation
[go record] start go language from scratch -- make an oscilloscope with go language (I) go language foundation
2022-07-08 00:51:00 【Ah Dan of maker Association】
I participated in a challenge today , Starting from scratch GO Language , For a week GO Language development of a serial port oscilloscope .
I haven't been in contact with GO Language , It's just C/C++, Learn from scratch GO, expect 8 Fast hours .
Use this for learning videos : Learning video
GO Language benefits : Simple and easy to use .
Dachang road , Yes C The foundation is easy to take off .
The goal is 
GO grammar :
GO Language variables 
Be similar to C Enumeration of languages :
Returns two values :


init and import Guide pack 


Be similar to include, stay GO It's called guide bag




Basic pointer ( Did you learn C You can skip )
defer( No define)
Finally execute in the form of stack .( It is roughly to set a stack in the function , Execute first, press in first , After the function runs , Out of the stack , The first is the last )
Follow the principle of "first in, second out" .


return The following statement is executed first .defer Finally, execute .
for loop :
len Calculate the length of the array :
The array length should match 

// What is passed is reference passing , It's a pointer ( Similar to array name , The type is int[])

slice Four methods of :
%v Is to print out variables variable It means , Joint output [].

Four statements slice The way :
by make() add to 
slice Slice addition and interception :
Capacity and length are different ,

The length is indeed 3, But capacity is an illegal pointer ptr Values outside ( from make The third parameter determines ), Want to operate the first one behind , Have to use append( Slice name [],2) It means appending a value to the slice name , by 2,
Reuse append( Slice name [],3) It can be added as the data of the fifth capacity , When it comes to the fifth or more , Reuse append( Slice name [],2) You can open up the length and capacity , The development size is the previous cap The capacity of ( Opened up at one time 5 individual , In an inch of land, an inch of gold flash Don't like to play like this )
copy function :
map Three declaration definitions of :
Now this is an empty map(==nil( Equivalent to NULL))
map usage :
边栏推荐
- Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades(KDD20)
- 8道经典C语言指针笔试题解析
- NVIDIA Jetson test installation yolox process record
- Password recovery vulnerability of foreign public testing
- Vscode software
- 浪潮云溪分布式数据库 Tracing(二)—— 源码解析
- What is load balancing? How does DNS achieve load balancing?
- 新库上线 | CnOpenData中华老字号企业名录
- Summary of weidongshan phase II course content
- Deep dive kotlin collaboration (the end of 23): sharedflow and stateflow
猜你喜欢

【obs】官方是配置USE_GPU_PRIORITY 效果为TRUE的

《因果性Causality》教程,哥本哈根大学Jonas Peters讲授
![[Yugong series] go teaching course 006 in July 2022 - automatic derivation of types and input and output](/img/79/f5cffe62d5d1e4a69b6143aef561d9.png)
[Yugong series] go teaching course 006 in July 2022 - automatic derivation of types and input and output

【GO记录】从零开始GO语言——用GO语言做一个示波器(一)GO语言基础

【笔记】常见组合滤波电路

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

接口测试要测试什么?

QT adds resource files, adds icons for qaction, establishes signal slot functions, and implements

第一讲:链表中环的入口结点

5g NR system messages
随机推荐
【obs】Impossible to find entrance point CreateDirect3D11DeviceFromDXGIDevice
韦东山第二期课程内容概要
取消select的默认样式的向下箭头和设置select默认字样
【obs】官方是配置USE_GPU_PRIORITY 效果为TRUE的
Development of a horse tourism website (realization of login, registration and exit function)
“一个优秀程序员可抵五个普通程序员”,差距就在这7个关键点
股票开户免费办理佣金最低的券商,手机上开户安全吗
去了字节跳动,才知道年薪 40w 的测试工程师有这么多?
51 communicates with the Bluetooth module, and 51 drives the Bluetooth app to light up
语义分割模型库segmentation_models_pytorch的详细使用介绍
Qt添加资源文件,为QAction添加图标,建立信号槽函数并实现
【obs】Impossible to find entrance point CreateDirect3D11DeviceFromDXGIDevice
Experience of autumn recruitment in 22 years
Hotel
Tencent security released the white paper on BOT Management | interpreting BOT attacks and exploring ways to protect
应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
Is it safe to speculate in stocks on mobile phones?
大二级分类产品页权重低,不收录怎么办?
Operating system principle --- summary of interview knowledge points
1293_ Implementation analysis of xtask resumeall() interface in FreeRTOS