代码文档生成工具Doxygen教程及实例,2024年最新2024最新阿里Golang面经

先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7

深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新Golang全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Go语言开发知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以添加V获取:vip1024b (备注go)
img

正文

Doxygen主要支持C语言,其它语法跟C差不多的语言(如:C++/C#/PHP/Java)也能够支持,我们称这类语言为「C语系语言」。而哪些跟C语法差异较大的语言叫做「非C语系语言」。
对于大多非C语系语言,Doxygen都是支持的,Doxygen原生支持这些语言:IDL、Java、Javascript、C#、C、C++、D、PHP、Objective-C、Python、Fortran、VHDL。
万一项目需要的语言(例如:Lua)Doxygen官方并不支持,那么只能自行编写「第三方语言扩展」来支持了。
1.Doxygen官方支持的语言见下图,文件名符合FILE_PATTERNS都会被处理。其中包括了.c、.h、.py等等。

图片

如果我们的扩展名并不在FILE_PATTERNS内,那么可以加上去。例如我们项目下的所有.ccc文件,其实是C语言代码(这很奇葩,举个例子而已)。那我们可以编辑Doxyfile配置文件满足这一需求,需要2个步骤。
(1) 在FILE_PATTERNS中添加*.ccc,如下图:

图片

(2) 在EXTENSION_MAPPING中添加映射规则ccc=C,如下图,语法是ext=language,其中language可以取的值有:IDL、Java、Javascript、C#、C、C++、D、PHP、Objective-C、Python、Fortran、VHDL。

图片

2.Doxygen官方不支持的语言
以Lua语言为例,它的代码是长这样的:

– \file lmath.h
–[[ 用于求一个角度的sin值,输入是字符串以便同时支持弧度制和角度制表示 \li 弧度制用pi表示,例如:2pi表示一圈、0.5pi表示直角 \li 角度制用d结尾,例如:360d表示一圈、90d表示直角 \li 输入也可以是数值,例如:输入3.14159大约表示180度
\param a 字符串类型,表示角度,用弧度制或角度制表示都行
\return 返回sin运算的结果
\todo 在xxx的情况下存在BUG,预计下一版本修复–]]function sin(a) return 1.123end

可以看到Lua的语法既不像C也不像Python。
本文就分享到这里,更详细的使用教程可以查看官方文档:

https://www.doxygen.nl/manual/doxygen_usage.html

转载于:https://mp.weixin.qq.com/s/XfaP6DF5G6lgXRJo8XAV2Q


如果只有一个没有注释的文件文件,一个没有注释的函数

image-20220429174231889

#include <stdio.h>

int main(void) {
printf(“Hello World!\n”);
}

最后产生的文档则是啥也没有。


还是一个源文件,文件有注释,函数也有两个,函数也都有注释

/**
* @file main.c
* @author JonesLee
* @email Jones_Lee3@163.com
* @version V4.01
* @date 07-DEC-2017
* @license GNU General Public License (GPL)
* @brief Universal Synchronous/Asynchronous Receiver/Transmitter
* @detail detail
* @attention
* This file is part of OST. \n
* This program is free software; you can redistribute it and/or modify \n
* it under the terms of the GNU General Public License version 3 as \n
* published by the Free Software Foundation. \n
* You should have received a copy of the GNU General Public License \n
* along with OST. If not, see http://www.gnu.org/licenses/. \n
* Unless required by applicable law or agreed to in writing, software \n
* distributed under the License is distributed on an “AS IS” BASIS, \n
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n
* See the License for the specific language governing permissions and \n
* limitations under the License. \n
* \n
* @htmlonly
* History
* @endhtmlonly
* Version|Auther|Date|Describe
* ------|----|------|--------
* V3.3|Jones Lee|07-DEC-2017|Create File
*

©COPYRIGHT 2017 WELLCASA All Rights Reserved.


*/

#include <stdio.h>

/**
* @brief hhhhh,this is a test file.
*
* @return int
*/
int add(int a, int b) {
return a+b;
}

int main(void) {
printf(“Hello World!\n”);
}

最后生成的文档如下图:

image-20220429180227347

image-20220429180150214

https://raw.githubusercontent.com/xkyvvv/blogpic3/main/image-20220429181945825.png


有多个源文件,每个文件有多个函数

在这里插入图片描述

main.c

/**
* @file main.c
* @author JonesLee
* @email Jones_Lee3@163.com
* @version V4.01
* @date 07-DEC-2017
* @license GNU General Public License (GPL)
* @brief Universal Synchronous/Asynchronous Receiver/Transmitter
* @detail detail
* @attention
* This file is part of OST. \n
* This program is free software; you can redistribute it and/or modify \n
* it under the terms of the GNU General Public License version 3 as \n
* published by the Free Software Foundation. \n
* You should have received a copy of the GNU General Public License \n
* along with OST. If not, see http://www.gnu.org/licenses/. \n
* Unless required by applicable law or agreed to in writing, software \n
* distributed under the License is distributed on an “AS IS” BASIS, \n
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n
* See the License for the specific language governing permissions and \n
* limitations under the License. \n
* \n
* @htmlonly
* History
* @endhtmlonly
* Version|Auther|Date|Describe
* ------|----|------|--------
* V3.3|Jones Lee|07-DEC-2017|Create File
*

©COPYRIGHT 2017 WELLCASA All Rights Reserved.


*/

#include <stdio.h>

/**
* @brief hhhhh,this is a test file.
*
* @return int
*/
int add(int a, int b) {
return a+b;
}

/**
* @brief sub function
*
* @return int
*/
int sub(int a, int b) {
return a-b;
}

/**
* @brief xkyzzz
*
* @return int
*/
int main(void) {
printf(“Hello World!\n”);
}

module.c

/**
* @file module.c
* @author xky
* @email Jones_Lee3@163.com
* @version V4.01
* @date 07-DEC-2017
* @license GNU General Public License (GPL)
* @brief Universal Synchronous/Asynchronous Receiver/Transmitter
* @detail detail
* @attention
* This file is part of OST. \n
* This program is free software; you can redistribute it and/or modify \n
* it under the terms of the GNU General Public License version 3 as \n
* published by the Free Software Foundation. \n
* You should have received a copy of the GNU General Public License \n
* along with OST. If not, see http://www.gnu.org/licenses/. \n
* Unless required by applicable law or agreed to in writing, software \n
* distributed under the License is distributed on an “AS IS” BASIS, \n
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n
* See the License for the specific language governing permissions and \n
* limitations under the License. \n
* \n
* @htmlonly
* History
* @endhtmlonly
* Version|Auther|Date|Describe
* ------|----|------|--------
* V3.3|Jones Lee|07-DEC-2017|Create File
*

©COPYRIGHT 2017 WELLCASA All Rights Reserved.


*/

/**
* @brief
*
*/
void mFun1(void)
{
;
}

/**
* @brief
*
*/
void mFun2(void)
{
;
}

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Go)
img

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
ief
*
*/
void mFun2(void)
{
;
}

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Go)
[外链图片转存中…(img-Qro4wH9U-1713191503778)]

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值