当前位置:网站首页>[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 :
边栏推荐
- 接口测试要测试什么?
- The weight of the product page of the second level classification is low. What if it is not included?
- "An excellent programmer is worth five ordinary programmers", and the gap lies in these seven key points
- 浪潮云溪分布式数据库 Tracing(二)—— 源码解析
- tourist的NTT模板
- Hotel
- Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades(KDD20)
- Which securities company has a low, safe and reliable account opening commission
- 应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
- 1293_ Implementation analysis of xtask resumeall() interface in FreeRTOS
猜你喜欢

Interface test advanced interface script use - apipost (pre / post execution script)

DNS 系列(一):为什么更新了 DNS 记录不生效?

新库上线 | CnOpenData中国星级酒店数据

ThinkPHP kernel work order system source code commercial open source version multi user + multi customer service + SMS + email notification

v-for遍历元素样式失效

Qt添加资源文件,为QAction添加图标,建立信号槽函数并实现

How does the markdown editor of CSDN input mathematical formulas--- Latex syntax summary

Cancel the down arrow of the default style of select and set the default word of select

C# 泛型及性能比较

Deep dive kotlin synergy (XXII): flow treatment
随机推荐
Basic mode of service mesh
Experience of autumn recruitment in 22 years
詹姆斯·格雷克《信息简史》读后感记录
"An excellent programmer is worth five ordinary programmers", and the gap lies in these seven key points
Operating system principle --- summary of interview knowledge points
Malware detection method based on convolutional neural network
应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
Zhou Hongqi, 52 ans, est - il encore jeune?
【测试面试题】页面很卡的原因分析及解决方案
FOFA-攻防挑战记录
C # generics and performance comparison
Development of a horse tourism website (optimization of servlet)
玩转Sonar
[Yugong series] go teaching course 006 in July 2022 - automatic derivation of types and input and output
ReentrantLock 公平锁源码 第0篇
【笔记】常见组合滤波电路
3 years of experience, can't you get 20K for the interview and test post? Such a hole?
Summary of the third course of weidongshan
深潜Kotlin协程(二十二):Flow的处理
ABAP ALV LVC template