当前位置:网站首页>【愚公系列】2022年7月 Go教学课程 004-Go代码注释
【愚公系列】2022年7月 Go教学课程 004-Go代码注释
2022-07-05 20:12:00 【InfoQ】
前言
1.注释的定义
2.注释的作用
一、Go代码注释
1.单行注释
//
// Add 两数相加(这一行会被截取为简短介绍)
// 两数相加的注意事项以及原理(这一行作为超级详细的介绍)
func Add(n1,n2 int)int{
return n1+n2
}
2.多行注释
/*
*/
/*
regexp 包为正则表达式实现了一个简单的库。
该库接受的正则表达式语法为:
regexp:
concatenation { '|' concatenation }
concatenation:
{ closure }
closure:
term [ '*' | '+' | '?' ]
term:
'^'
'$'
'.'
character
'[' [ '^' ] character-ranges ']'
'(' regexp ')'
*/
package regexp
总结

边栏推荐
- Debezium series: parsing the default value character set
- Summer Challenge harmonyos - realize message notification function
- Leetcode: binary tree 15 (find the value in the lower left corner of the tree)
- Android interview classic, 2022 Android interview written examination summary
- 银河证券在网上开户安全吗?
- Jvmrandom cannot set seeds | problem tracing | source code tracing
- 强化学习-学习笔记4 | Actor-Critic
- Cocos2d-x项目总结中的一些遇到的问题
- js方法传Long类型id值时会出现精确损失
- c語言oj得pe,ACM入門之OJ~
猜你喜欢
leetcode刷题:二叉树17(从中序与后序遍历序列构造二叉树)
About the priority of Bram IP reset
js实现禁止网页缩放(Ctrl+鼠标、+、-缩放有效亲测)
[quick start of Digital IC Verification] 9. Finite state machine (FSM) necessary for Verilog RTL design
14. Users, groups, and permissions (14)
Guidelines for application of Shenzhen green and low carbon industry support plan in 2023
无卷积骨干网络:金字塔Transformer,提升目标检测/分割等任务精度(附源代码)...
[quick start of Digital IC Verification] 3. Introduction to the whole process of Digital IC Design
微信小程序正则表达式提取链接
.Net分布式事務及落地解决方案
随机推荐
信息学奥赛一本通 1337:【例3-2】单词查找树 | 洛谷 P5755 [NOI2000] 单词查找树
selenium 元素信息
解决Thinkphp框架应用目录下数据库配置信息修改后依然按默认方式连接
Redis cluster simulated message queue
kubernetes资源对象介绍及常用命令(五)-(ConfigMap&Secret)
Debezium series: modify the source code to support drop foreign key if exists FK
Tasks in GStreamer
【数字IC验证快速入门】2、通过一个SoC项目实例,了解SoC的架构,初探数字系统设计流程
ROS2专题【01】:win10上安装ROS2
leetcode刷题:二叉树15(找树左下角的值)
Is it safe for CICC fortune to open an account online?
leetcode刷题:二叉树14(左叶子之和)
S7-200smart uses V90 Modbus communication control library to control the specific methods and steps of V90 servo
.Net分布式事务及落地解决方案
2022年7月4日-2022年7月10日(ue4视频教程mysql)
Build your own website (16)
无卷积骨干网络:金字塔Transformer,提升目标检测/分割等任务精度(附源代码)...
Flume series: interceptor filtering data
Go language | 01 wsl+vscode environment construction pit avoidance Guide
淺淺的談一下ThreadLocalInsecureRandom