在使用Goland开发go项目的时候,突然有一次遇到有些包下面的类无法被引用的情况,排查下来发现是这些包下面的config.go文件无法被正常识别成go代码文件

从而导致下面无法引用其他包中的所有config.go文件中的类
kratos无法正常引用

gorm的gen无法正常引用

解决方法是去File Type下面的File type auto-detected by file content下面将config.go配置删除,就可以解决这个问题

在使用Goland开发go项目的时候,突然有一次遇到有些包下面的类无法被引用的情况,排查下来发现是这些包下面的config.go文件无法被正常识别成go代码文件
从而导致下面无法引用其他包中的所有config.go文件中的类
kratos无法正常引用
gorm的gen无法正常引用
解决方法是去File Type下面的File type auto-detected by file content下面将config.go配置删除,就可以解决这个问题
1 | func main() { |
配置arg
输出
1 | Hello World |
注意arg[0]是go程序的运行目录
golang内置的标准库flag,可以用来读取配置文件的路径
1 | func main() { |
配置
yaml配置
1 | port: 7890 |
如果使用yt-dlp音源需要额外安装
拔掉USB线, 重新连上HDMI, 加电, 系统开机就是新的安卓系统了
使用的系统是20180123-S905L-R3300L-V12C-root-qlzy
参考:R3300L运行CoreELEC, EmuELEC和Armbia
双系统不用把armbian系统刷进emmc,需要在安卓系统中安装Reboot to LibreELEC的apk来启动TF卡系统,装上TF卡就自动进行armbian系统
参考:魔百盒R3300L、CM101H以及中兴ZX10 B860AV1.2刷armbian跑甜糖
使用的系统版本是Armbian_20.10_Arm-64_buster_current_5.9.0.img
1 | cp /etc/apt/sources.list /etc/apt/sources.list.bak |
换成清华源
1 | deb https://mirrors.tuna.tsinghua.edu.cn/debian buster main contrib non-free |
当我们开发的系统想要使用第三方账号系统(比如微信,微博,facebook)进行登录的时候,就需要使用第三方平台的登录能力,下面是各第三方平台的对接文档
关于oauth和oauth2.0:理解OAuth 2.0
https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html
web端
app移动端,可以使用refresh token
官方镜像仓库selenium/standalone-chrome,只支持amd64
拉取镜像
1 | docker pull selenium/standalone-chrome:120.0 |
启动
1 | docker run -d -p 4444:4444 -p 15900:5900 selenium/standalone-chrome:120.0 |
其他参数
1 | docker run -d -p 4444:4444 -p 15900:5900 -e SE_NODE_MAX_SESSIONS=5 --shm-size=2g selenium/standalone-chrome:120.0 |
参考:https://hub.docker.com/r/selenium/standalone-chrome
访问 localhost:4444/ui 可以查看selenium的运行状态
多表连接查询
1 | # 返回的是两张表的乘积 |
参考:https://www.begtut.com/mysql/mysql-rollup.html
子查询
某些情况下,当运行查询的时候,需要的条件是另外一个select语句的结果,这个时候,就要用到子查询
1 | #子查询 |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
ModHeader全名modify header,这是一款可以对HTTP请求header进行修改的插件,其支持添加模式Mod和过滤器Filter。
Mod可以支持对request的header,response的header进行修改,对请求进行重定向redirect等;
Filter支持对特定的URL生效这面的这些Mod