当前位置:网站首页>【愚公系列】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
总结
边栏推荐
- 信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage
- 随机数生成的四种方法|Random|Math|ThreadLocalRandom|SecurityRandom
- How to retrieve the root password of MySQL if you forget it
- [C language] merge sort
- USACO3.4 “破锣摇滚”乐队 Raucous Rockers - DP
- Where is the operation of new bonds? Is it safer and more reliable to open an account
- Debezium series: parsing the default value character set
- 怎么挑选好的外盘平台,安全正规的?
- Leetcode skimming: binary tree 16 (path sum)
- sun.misc.BASE64Encoder报错解决方法[通俗易懂]
猜你喜欢
Leetcode brush question: binary tree 14 (sum of left leaves)
JVMRandom不可设置种子|问题追溯|源码追溯
Elk distributed log analysis system deployment (Huawei cloud)
【数字IC验证快速入门】6、Questasim 快速上手使用(以全加器设计与验证为例)
Unity编辑器扩展 UI控件篇
Leetcode: binary tree 15 (find the value in the lower left corner of the tree)
建立自己的网站(16)
kubernetes资源对象介绍及常用命令(五)-(ConfigMap&Secret)
【数字IC验证快速入门】9、Verilog RTL设计必会的有限状态机(FSM)
After 95, Alibaba P7 published the payroll: it's really fragrant to make up this
随机推荐
About the priority of Bram IP reset
MySql的root密码忘记该怎么找回
无卷积骨干网络:金字塔Transformer,提升目标检测/分割等任务精度(附源代码)...
Complete interview questions for interviewers and senior Android engineers in front-line Internet enterprises
随机数生成的四种方法|Random|Math|ThreadLocalRandom|SecurityRandom
Is it safe for CICC fortune to open an account online?
Based on vs2017 and cmake GUI configuration, zxing and opencv are used in win10 x64 environment, and simple detection of data matrix code is realized
挖财钱堂教育靠谱安全吗?
sun. misc. Base64encoder error reporting solution [easy to understand]
2020 CCPC 威海 - A. Golden Spirit(思维),D. ABC Conjecture(大数分解 / 思维)
Rainbond 5.7.1 支持对接多家公有云和集群异常报警
leetcode刷题:二叉树15(找树左下角的值)
期货如何网上开户?安不安全?
Is it safe for Galaxy Securities to open an account online?
1:引文;
图嵌入Graph embedding学习笔记
Win10 x64环境下基于VS2017和cmake-gui配置使用zxing以及opencv,并实现data metrix码的简单检测
Bzoj 3747 poi2015 kinoman segment tree
kubernetes资源对象介绍及常用命令(五)-(ConfigMap&Secret)
Leetcode skimming: binary tree 10 (number of nodes of a complete binary tree)