low-code 和 serverless – 冰与火?

对于业务应用程序的要求不断提高,但是 IT 部门困于大量的应用程序积压的工作而不可能很快的完成工作。而且,目前面临的挑战是,IT 需要重新思考提高交付速度的方法。有两个解决方案:low-code 和 server…

2021 北京 Gopher 大会

托 团队 leader 的福,白嫖了今年 GopherCon China 的票,和历届大会相比,第二天分了两个分会场, 分享不同的内容,参会者可以根据个人兴趣自行选择参加。 然而不得不说,本次和之前几次的分享安排相比,多了一些针对自己公司产品的推广。…

Go 简单而强大的反向代理(Reverse Proxy)

在本文中,我们将了解反向代理,它的应用场景以及如何在 Golang 中实现它。 反向代理是位于 Web 服务器前面并将客户端(例如 Web 浏览器)的请求转发到 Web 服务器的服务器。 它们让你可以控制来自客户端的请求和来自服务器的响应,然…

Unescape values in html templates using golang

While using values in a html template, my colleague faced a problem that the values in <script> tags were all escaped. So the template developer can not use the values in javascript. It just looks like this: // ... <script type="text/json" id="channel" ch="recommend" tk=""> [&#34;news&#34;,&#34;comedy&#34;,&#34;cartoon&#34;,&#34;tech&#34;,&#34;travelling&#34;,&#34;fashion&#34;,&#34;photograph&#34;,&#34;household&#34;,&#34;movies&#34;,&#34;foods&#34;,&#34;military&#34;,&#34;health&#34;,&#34;test&#34;] </script> // ... I tried to find out the reason. So I copied the template values in other HTML tags, like <div>, rather than in <script>. It rendered correctly, and was not escaped: // ... <div> ["news","comedy","cartoon","tech","travelling","fashion","photograph","household","movies","foods","military","health","test"] <div> // ... I start google the reason. At first, I thought it was because the values given template is wrong, it had already been escaped before the page rendering.

go module 使用 gitlab 私有仓库

Go Module 使用 gitlab 私有仓库 包管理是 Go 一直被诟病做的不好的功能。在 1.11 之前,go get 缺乏对依赖包版本管理和 reproducible build 的支持。 当时在 Go 社区当时诞生了许多好用的工具,比如 glide,dep 等。 在 1.11 版本之后, Go 引入了 Go Modu…

如何在 Go 中组织项目结构

译者注:在翻译这篇文章之前,我自己其实对 Bob 大叔的 Clean Architecture 也做过一些研究,在项目中实践之后, 也确确实实体验到了分层的魅力。在层与层之间将依赖进行隔离,各个层只关注自己本身的逻辑, 所以能让开发者只关注本层的业…

使用 Github Actions 自动发布 hugo 站点

从 2018 年底到 2021 年初,博客一直搁置,虽然也偶尔写几篇文章,但是都发布在团队的公众号中了, 现在重新开始维护自己的博客,也从 hexo 转移到了 hugo , 这两个都是非常优秀的静态网站生成工具。 但是不得不说,使用 hugo 之后感觉易用…