当前位置:网站首页>[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 :
边栏推荐
- Service Mesh介绍,Istio概述
- How does the markdown editor of CSDN input mathematical formulas--- Latex syntax summary
- 测试流程不完善,又遇到不积极的开发怎么办?
- NVIDIA Jetson测试安装yolox过程记录
- Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades(KDD20)
- Development of a horse tourism website (realization of login, registration and exit function)
- 深潜Kotlin协程(二十二):Flow的处理
- jemter分布式
- Cancel the down arrow of the default style of select and set the default word of select
- tourist的NTT模板
猜你喜欢

基于卷积神经网络的恶意软件检测方法

QT establish signal slots between different classes and transfer parameters

搭建ADG过程中复制报错 RMAN-03009 ORA-03113

玩轉Sonar

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

《因果性Causality》教程,哥本哈根大学Jonas Peters讲授

DNS series (I): why does the updated DNS record not take effect?

C language 001: download, install, create the first C project and execute the first C language program of CodeBlocks

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

Huawei switch s5735s-l24t4s-qa2 cannot be remotely accessed by telnet
随机推荐
牛客基础语法必刷100题之基本类型
从服务器到云托管,到底经历了什么?
NVIDIA Jetson测试安装yolox过程记录
Service Mesh的基本模式
Tencent security released the white paper on BOT Management | interpreting BOT attacks and exploring ways to protect
RPA cloud computer, let RPA out of the box with unlimited computing power?
1293_FreeRTOS中xTaskResumeAll()接口的实现分析
Deep dive kotlin collaboration (the end of 23): sharedflow and stateflow
Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades(KDD20)
爬虫实战(八):爬表情包
【测试面试题】页面很卡的原因分析及解决方案
"An excellent programmer is worth five ordinary programmers", and the gap lies in these seven key points
Installation and configuration of sublime Text3
Cause analysis and solution of too laggy page of [test interview questions]
第一讲:链表中环的入口结点
8道经典C语言指针笔试题解析
新库上线 | 中国记者信息数据
New library online | cnopendata China Star Hotel data
Is Zhou Hongyi, 52, still young?
Codeforces Round #804 (Div. 2)(A~D)