当前位置:网站首页>[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 :
边栏推荐
- How does the markdown editor of CSDN input mathematical formulas--- Latex syntax summary
- Development of a horse tourism website (realization of login, registration and exit function)
- 股票开户免费办理佣金最低的券商,手机上开户安全吗
- Is it safe to speculate in stocks on mobile phones?
- tourist的NTT模板
- They gathered at the 2022 ecug con just for "China's technological power"
- Solution to the problem of unserialize3 in the advanced web area of the attack and defense world
- 51 communicates with the Bluetooth module, and 51 drives the Bluetooth app to light up
- Semantic segmentation model base segmentation_ models_ Detailed introduction to pytorch
- Introduction to paddle - using lenet to realize image classification method I in MNIST
猜你喜欢
第一讲:链表中环的入口结点
Malware detection method based on convolutional neural network
1293_ Implementation analysis of xtask resumeall() interface in FreeRTOS
Interface test advanced interface script use - apipost (pre / post execution script)
[OBS] the official configuration is use_ GPU_ Priority effect is true
Huawei switch s5735s-l24t4s-qa2 cannot be remotely accessed by telnet
大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
[Yugong series] go teaching course 006 in July 2022 - automatic derivation of types and input and output
去了字节跳动,才知道年薪 40w 的测试工程师有这么多?
国外众测之密码找回漏洞
随机推荐
Which securities company has a low, safe and reliable account opening commission
哪个券商公司开户佣金低又安全,又靠谱
FOFA-攻防挑战记录
If an exception is thrown in the constructor, the best way is to prevent memory leakage?
5g NR system messages
测试流程不完善,又遇到不积极的开发怎么办?
Cause analysis and solution of too laggy page of [test interview questions]
Qt不同类之间建立信号槽,并传递参数
从服务器到云托管,到底经历了什么?
动态库基本原理和使用方法,-fPIC 选项的来龙去脉
【obs】Impossible to find entrance point CreateDirect3D11DeviceFromDXGIDevice
What if the testing process is not perfect and the development is not active?
22年秋招心得
NVIDIA Jetson测试安装yolox过程记录
After going to ByteDance, I learned that there are so many test engineers with an annual salary of 40W?
My best game based on wechat applet development
ABAP ALV LVC template
Tapdata 的 2.0 版 ,开源的 Live Data Platform 现已发布
Jouer sonar
去了字节跳动,才知道年薪 40w 的测试工程师有这么多?