当前位置:网站首页>【愚公系列】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
总结

边栏推荐
猜你喜欢

Leetcode skimming: binary tree 16 (path sum)

【数字IC验证快速入门】8、数字IC中的典型电路及其对应的Verilog描述方法

Leetcode brush questions: binary tree 11 (balanced binary tree)

IC科普文:ECO的那些事儿

Unity编辑器扩展 UI控件篇

【数字IC验证快速入门】6、Questasim 快速上手使用(以全加器设计与验证为例)

Redis cluster simulated message queue

Wechat applet regular expression extraction link

About the priority of Bram IP reset
![信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage](/img/f0/0f985425bd61d9852af0b5fd7307ee.png)
信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage
随机推荐
Unity编辑器扩展 UI控件篇
Leetcode skimming: binary tree 16 (path sum)
. Net distributed transaction and landing solution
信息学奥赛一本通 1337:【例3-2】单词查找树 | 洛谷 P5755 [NOI2000] 单词查找树
[quick start of Digital IC Verification] 3. Introduction to the whole process of Digital IC Design
中金财富在网上开户安全吗?
After 95, Alibaba P7 published the payroll: it's really fragrant to make up this
股票开户哪里好?网上客户经理开户安全吗
Convolution free backbone network: Pyramid transformer to improve the accuracy of target detection / segmentation and other tasks (with source code)
本季度干货导航 | 2022年Q2
【c语言】快速排序的三种实现以及优化细节
ffplay文档[通俗易懂]
leetcode刷题:二叉树12(二叉树的所有路径)
CADD课程学习(7)-- 模拟靶点和小分子相互作用 (半柔性对接 AutoDock)
Leetcode skimming: binary tree 12 (all paths of binary tree)
《乔布斯传》英文原著重点词汇笔记(十二)【 chapter ten & eleven】
ICTCLAS word Lucene 4.9 binding
JS implementation prohibits web page zooming (ctrl+ mouse, +, - zooming effective pro test)
Is it safe for Guosen Securities to open an account online?
js方法传Long类型id值时会出现精确损失