前言
在 CentOS 9 x64 系统上,可以通过以下步骤来部署 Golang 服务。
1. 安装必要的软件包
安装以下软件包:
- Golang:Golang 编程语言
- Nginx:Web 服务器
- Supervisor:进程管理工具
- Git:版本控制工具
- EPEL:扩展软件包
"CentOS 9 x64 使用 Nginx、Supervisor 部署 Go/Golang 服务"继续阅读
在 CentOS 9 x64 系统上,可以通过以下步骤来部署 Golang 服务。
安装以下软件包:
"CentOS 9 x64 使用 Nginx、Supervisor 部署 Go/Golang 服务"继续阅读
作为文档工具人,经常需要把代码里面的注释转换成语义化的 Markdown 文档,有时也需要进行反向操作。以前是写正则表达式全局匹配,时间长了这种方式也变得繁琐乏味。所以写了脚本来互转,增加一些便捷性。
"快捷转换/互转 Markdown 文档和 TypeScript/TypeDoc 注释"继续阅读
在 Go 中,可以使用 fmt.Sprintf()
和 fmt.Printf()
函数来格式化字符串,这两个函数类似于 C 语言中的 scanf
和 printf
函数。
"Go 中的格式化字符串 `fmt.Sprintf()` 和 `fmt.Printf()`"继续阅读
读完时间:2022 年 9 月 20 日
出版时间:2021 年 10 月 14 日
Compared to everything else we have to learn, new languages often feel like a poor investment of our time.
"读书笔记:《The Little Go Book》 – Karl Seguin 著"继续阅读
apt-get update
apt-get install -y supervisor
service supervisor start
"使用 Supervisor 部署 Go(Golang) 应用"继续阅读
在日常的前端开发中,倘若想验证一个业务功能正向性,需要针对部分用户进行灰度实验。
用一个轻量级的 H5 页面做流量中转,收集完用户信息后使用 Ajax
来请求后端接口来判断一个用户是否命中灰度,再通过 location.href
或 location.replace
来做相应的页面跳转。
优点:
缺点:
示例:
ajax.get('https://getwhich.com').then( abValue => { let jumpUrl = 'https://default.com' if (abValue === 'iAmExp') { jumpUrl = 'https://exp.com' } location.href = jumpUrl } )
"使用 Golang & MurmurHash & JsonLogic 实现前端资源灰度分流"继续阅读