当前位置:网站首页>[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 standby database has been delayed. Check that the MRP is wait_ for_ Log, apply after restarting MRP_ Log but wait again later_ for_ log
- “一个优秀程序员可抵五个普通程序员”,差距就在这7个关键点
- The underlying principles and templates of new and delete
- Summary of weidongshan phase II course content
- [研发人员必备]paddle 如何制作自己的数据集,并显示。
- Service Mesh的基本模式
- Su embedded training - Day3
- 搭建ADG过程中复制报错 RMAN-03009 ORA-03113
- [Yugong series] go teaching course 006 in July 2022 - automatic derivation of types and input and output
- Hotel
猜你喜欢
Reentrantlock fair lock source code Chapter 0
51 communicates with the Bluetooth module, and 51 drives the Bluetooth app to light up
Kubernetes Static Pod (静态Pod)
v-for遍历元素样式失效
Tencent security released the white paper on BOT Management | interpreting BOT attacks and exploring ways to protect
备库一直有延迟,查看mrp为wait_for_log,重启mrp后为apply_log但过一会又wait_for_log
[研发人员必备]paddle 如何制作自己的数据集,并显示。
【笔记】常见组合滤波电路
取消select的默认样式的向下箭头和设置select默认字样
Analysis of 8 classic C language pointer written test questions
随机推荐
基于微信小程序开发的我最在行的小游戏
Analysis of 8 classic C language pointer written test questions
The standby database has been delayed. Check that the MRP is wait_ for_ Log, apply after restarting MRP_ Log but wait again later_ for_ log
[Yugong series] go teaching course 006 in July 2022 - automatic derivation of types and input and output
3 years of experience, can't you get 20K for the interview and test post? Such a hole?
Is it safe to open an account on the official website of Huatai Securities?
RPA云电脑,让RPA开箱即用算力无限?
STL--String类的常用功能复写
QT adds resource files, adds icons for qaction, establishes signal slot functions, and implements
ReentrantLock 公平锁源码 第0篇
Is it safe to speculate in stocks on mobile phones?
测试流程不完善,又遇到不积极的开发怎么办?
How to insert highlighted code blocks in WPS and word
Leetcode brush questions
C# 泛型及性能比较
51 communicates with the Bluetooth module, and 51 drives the Bluetooth app to light up
韦东山第三期课程内容概要
The method of server defense against DDoS, Hangzhou advanced anti DDoS IP section 103.219.39 x
Introduction to paddle - using lenet to realize image classification method I in MNIST
他们齐聚 2022 ECUG Con,只为「中国技术力量」