使用gotests可以很方便的生成表驱动测试代码,表驱动测试的具体内容,请参考go官方的wiki。下面是具体的使用方法。
安装 使用下面命令进行安装
go install github.com/cweill/gotests/gotests@latest 如果是go1.16之前的版本,可以使用命令 go get -u github.com/cweill/gotests/...来进行安装。
使用 gotests支持的参数如下:
Usage of C:\Users\czyt\go\bin\gotests.exe: -all generate tests for all functions and methods -excl string regexp. generate tests for functions and methods that don't match. Takes precedence over -only, -exported, and -all -exported generate tests for exported functions and methods. Takes precedence over -only and -all -i print test inputs in error messages -nosubtests disable generating tests using the Go 1....
本文部分内容基于manjaro,另外如果喜欢苹果界面,可以试下pearos
更换软件源 使用中国的镜像排名
sudo pacman-mirrors -i -c China -m rank //更新镜像排名 sudo pacman -Syy //更新数据源 sudo pacman-mirrors -g //排列数据源 添加archlinuxcn源编辑命令 sudo nano /etc/pacman.conf 添加下面的内容
[archlinuxcn] SigLevel = Optional TrustedOnly #中科大源 Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch #清华源 # Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch # 163源 # Server = http://mirrors.163.com/archlinux-cn/$arch 然后再更新软件数据源
sudo pacman -Syy sudo pacman -S archlinux-keyring archlinuxcn-keyring 如何证书有问题,可以使用下面的命令进行修复,参考官方wiki
sudo pacman-key --init && sudo pacman-key --populate 因为本文的软件使用yay进行安装,故需要使用命令进行安装,命令为 sudo pacman -S yay 设置yay的mirror
yay --aururl "https://aur....