摘要:
The problem is simpler than it looks. You convert a rune value to an int value with int(r). But your code implies you want the integer value out of th 阅读全文
摘要:
shell 字符串小写转大写 shell字符串拼接 对于变量或者字符串的连接,shell提供了相当简单的做法 直接放到一起或用双引号即可 golang 编译时加入额外信息 golang中我们在编译时可以使用-ldflags编译选项来添加一些信息,这些信息会被写入到目标文件中 交叉编译 GOOS:目标 阅读全文
摘要:
echo要支持同C语言一样的\转义功能,只需要加上参数-e,如下所示: 阅读全文
摘要:
drone 更新仓库为truested 阅读全文
摘要:
Ubuntu ssh一直无法启动。 通过 systemctl status ssh.service 查看到的错误是 Dec 16 13:35:22 iZm5eckxl2tqyka9eoe7b3Z systemd[1]: Starting OpenBSD Secure Shell server...D 阅读全文
摘要:
golang结构体json格式化的时间格式 在我们开发中,经常会解析time.Time 往往前台传过来的时候,是个string 但是我们希望在结构体转成time.Time 如果直接使用json.UnmarshalJSON会失败。我们需要重写UnmarshalJSON和MarshalJSON方法 如果 阅读全文
摘要:
我们经常会在网站追踪用户的信息,比如记录用户的停留时间。 但是如果发送是XHR请求的话。页面会阻塞。google了发现有一个api是可以支持的 大致是说 navigator.sendBeacon 可以用来发送一些小量的数据,特别适合统计场景,且这个请求是异步的,不受浏览器行为限制:即使浏览器关闭请求 阅读全文
摘要:
作者:腾讯技术工程链接:https://www.zhihu.com/question/22867411/answer/911161400来源:知乎 (1)brew 安装: (2)brew cask 安装 (3)其他工具 下载工具 motrix 看/截图工具 jietu brew cask tools 阅读全文
摘要:
安装 $go get -u github.com/cweill/gotests/... 复制代码 具体使用示例 用法 $gotests [options] PATH ... 复制代码 options说明 -all generate go tests for all functions and met 阅读全文
摘要:
由于工作或者其他原因,有时候我们会修改git的用户名和邮箱账号,没有改过来就提交,就会导致提交人信息不一致的问题。现在记录修正回来的方法 阅读全文