<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Land of Unknwon</title>
    <link>https://unknwon.io/</link>
    <description>Recent content on Land of Unknwon</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 26 Jan 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://unknwon.io/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Managing Gogs infrastructure with DigitalOcean Kubernetes</title>
      <link>https://unknwon.io/posts/260126-gogs-digitalocean-kubernetes/</link>
      <pubDate>Mon, 26 Jan 2026 00:00:00 +0000</pubDate>
      <guid>https://unknwon.io/posts/260126-gogs-digitalocean-kubernetes/</guid>
      <description>&lt;h2 id=&#34;another-brief-history&#34;&gt;&#xA;  A(nother) brief history&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#another-brief-history&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;In 2024, we presented the &lt;a href=&#34;https://unknwon.io/posts/241215-gogs-digitalocean-pulumi&#34; &gt;Grand scheme of managing Gogs infrastructure on DigitalOcean with Pulumi&lt;/a&gt;, where we fully migrated the entire lifecycle of Gogs infrastructure onto Pulumi as the chosen Infrastructure as Code (IaC) provider.&lt;/p&gt;&#xA;&lt;p&gt;However, while all infrastructure resources are managed via IaC, we still have to hand roll every service we own, whose configuration and state cannot be easily persistent and managed in a Git repository. This year, we upgraded everything onto &lt;a href=&#34;https://www.digitalocean.com/products/kubernetes&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;DigitalOcean&amp;rsquo;s Kubernetes (DOKS) platform&lt;/a&gt;, unlocking more streamlined service management, in a &amp;ldquo;modern&amp;rdquo; way.&lt;/p&gt;</description>
    </item>
    <item>
      <title>About</title>
      <link>https://unknwon.io/about/</link>
      <pubDate>Thu, 30 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://unknwon.io/about/</guid>
      <description>&lt;hr&gt;&#xA;&lt;p&gt;Welcome!&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m a pessimistic nerd who is deep in the weeds of infrastructure, security, and dev tooling.&lt;/p&gt;&#xA;&lt;p&gt;I work at &lt;a href=&#34;https://pierre.computer&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Pierre Computer Company&lt;/a&gt;. Outside work, I am an open source enthusiast build things for the poor.&lt;/p&gt;&#xA;&lt;p&gt;I am also running a newsletter &lt;a href=&#34;https://unknwon.substack.com/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Identity, Authenticity, and Security&lt;/a&gt;, if you like my work, please consider give my it a look!&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve programed with VB 6.0, VB.NET, C# from 2011 to 2013.&lt;/p&gt;&#xA;&lt;p&gt;I start coding in Go since 2013 and have been doing a lot work with it, some of them including:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Managing stack pull requests with git-spice</title>
      <link>https://unknwon.io/posts/251029-stack-pull-requests-git-spice/</link>
      <pubDate>Wed, 29 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://unknwon.io/posts/251029-stack-pull-requests-git-spice/</guid>
      <description>&lt;p&gt;This blog post is a counterpart of my earlier post &lt;a href=&#34;../231124-stack-pull-requests-graphite&#34; &gt;Managing stack pull requests with Graphite&lt;/a&gt;. Because I have quit my previous company that purchases Graphite licenses, and also because Graphite is priced ridiculously high (that I can&amp;rsquo;t afford out-of-pocket), and I don&amp;rsquo;t use its UI, for reasons, I am still more comfortable using GitHub UI, maybe because that&amp;rsquo;s more familiar to me. $20 per user/month is too much compared to $4 per user/month of my GitHub Pro, that comes with almost everything.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Babysitting and AI agents -- Six-year recap at Sourcegraph</title>
      <link>https://unknwon.io/posts/250910-babysitting-and-ai-agents/</link>
      <pubDate>Wed, 10 Sep 2025 00:00:00 +0000</pubDate>
      <guid>https://unknwon.io/posts/250910-babysitting-and-ai-agents/</guid>
      <description>&lt;h2 id=&#34;preface&#34;&gt;&#xA;  Preface&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#preface&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;It has been another &lt;a href=&#34;https://unknwon.io/posts/220701-three-years-at-sourcegraph/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;three years at Sourcegraph&lt;/a&gt; to make my six-year anniversary, I can’t stop saying that time flies. My life has changed a lot, my role at work has changed a lot, and the world has changed a lot. It’s a(nother) good time to sit back and, as I always like to say, think it through. To think about what exactly, though? I think it would be something like how to balance work, life and the future.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Your AI coding agent is a spy</title>
      <link>https://unknwon.io/posts/250727-your-ai-coding-agent-is-a-spy/</link>
      <pubDate>Sun, 27 Jul 2025 00:00:00 +0000</pubDate>
      <guid>https://unknwon.io/posts/250727-your-ai-coding-agent-is-a-spy/</guid>
      <description>&lt;h2 id=&#34;dont-scare-me&#34;&gt;&#xA;  Don’t scare me&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#dont-scare-me&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Started with GitHub Copilot for code completion to now using AI coding agents to write your code. One thing that doesn&amp;rsquo;t change is that it keeps uploading context from your codebase that deem appropriate without you auditing them (which would be annoying enough to make these tools actually useful).&lt;/p&gt;&#xA;&lt;p&gt;That leaves the obvious hole that what exact context was being passed to the LLM provider is usually not visible enough to the end user and almost certainly in your local dev environment, you have secrets laying around in your &lt;code&gt;.envrc&lt;/code&gt;, &lt;code&gt;env.local&lt;/code&gt; and you shell history, or even sometimes directly exist in the code file that you’re trying to hack something real quick.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AI coding agent one-shot challenge with Amp, Claude Code and Gemini</title>
      <link>https://unknwon.io/posts/250722-ai-agent-one-shot-challenge/</link>
      <pubDate>Tue, 22 Jul 2025 00:00:00 +0000</pubDate>
      <guid>https://unknwon.io/posts/250722-ai-agent-one-shot-challenge/</guid>
      <description>&lt;h2 id=&#34;why-am-i-doing-this&#34;&gt;&#xA;  Why am I doing this?&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#why-am-i-doing-this&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;I kinda set up myself for failure over the years to some degree that I opened up probably too many side projects on GitHub.com. Then with all the life commitments, I can barely keep up with the throughput that I want vs. the actual hours I can realistically devote to them. All the shower ideas, refactoring, feature development, bug fixes, etc. every single one of them could easily eat up a day for me, and there are several hundreds of them.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Grand scheme of managing Gogs infrastructure on DigitalOcean with Pulumi</title>
      <link>https://unknwon.io/posts/241215-gogs-digitalocean-pulumi/</link>
      <pubDate>Sun, 15 Dec 2024 00:00:00 +0000</pubDate>
      <guid>https://unknwon.io/posts/241215-gogs-digitalocean-pulumi/</guid>
      <description>&lt;h2 id=&#34;a-brief-history&#34;&gt;&#xA;  A brief history&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#a-brief-history&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The Gogs project has been proudly sponsored by &lt;a href=&#34;https://www.digitalocean.com/?refcode=5aeb02268b55&amp;amp;utm_campaign=Referral_Invite&amp;amp;utm_medium=Referral_Program&amp;amp;utm_source=badge&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;DigitalOcean&lt;/a&gt; since 2015 via its &lt;a href=&#34;https://www.digitalocean.com/open-source/credits-for-projects&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Open Source Credits program&lt;/a&gt;. Benefited from that, the official website (&lt;a href=&#34;https://gogs.io&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://gogs.io&lt;/a&gt;) and demo site (&lt;a href=&#34;https://try.gogs.io&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://try.gogs.io&lt;/a&gt;) infrastructure has been hosted on DigitalOcean ever since.&lt;/p&gt;&#xA;&lt;p&gt;For a very long time, we have been using a beefy machine (a DigitalOcean Droplet) to host everything we use, including the service itself, the data storage, the database, and almost everything that&amp;rsquo;s related.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Managing stack pull requests with Graphite</title>
      <link>https://unknwon.io/posts/231124-stack-pull-requests-graphite/</link>
      <pubDate>Fri, 24 Nov 2023 00:00:00 +0000</pubDate>
      <guid>https://unknwon.io/posts/231124-stack-pull-requests-graphite/</guid>
      <description>&lt;p&gt;&lt;strong&gt;UPDATE 2025-10-29&lt;/strong&gt;: If you can&amp;rsquo;t afford Graphite like me, try &lt;a href=&#34;../251029-stack-pull-requests-git-spice&#34; &gt;Managing stack pull requests with git-spice&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In Software Engineering, we all have seen this meme:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://unknwon.io/img/231124/code-review-meme.png&#34; alt=&#34;GopherCon Check&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s not only about writing the code, but also being able to be reviewed effectively by peers.&lt;/p&gt;&#xA;&lt;p&gt;Therefore, pull requests with smaller diffs are always preferred.&lt;/p&gt;&#xA;&lt;p&gt;However, developers face many challenges when actually practicing this approach, especially when doing it with as-of-now the most popular code collaboration mode, trunk-based development. In particular, smaller diffs means more pull requests for a serie of changes that are dependent on top of the other. We refer to them as &lt;a href=&#34;https://stacking.dev/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;stacked&lt;/a&gt; &lt;a href=&#34;https://www.michaelagreiler.com/stacked-pull-requests/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;pull requests&lt;/a&gt;. Now, we have a dependency management issue with Git branches. Not only that, whenever the depended branch gets merged, there is a serie of &amp;ldquo;merges&amp;rdquo; or &amp;ldquo;rebases&amp;rdquo; for all the dependent pull requests.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Running on a high-speed rail</title>
      <link>https://unknwon.io/posts/230701-running-on-a-high-speed-rail/</link>
      <pubDate>Sat, 01 Jul 2023 00:00:00 +0000</pubDate>
      <guid>https://unknwon.io/posts/230701-running-on-a-high-speed-rail/</guid>
      <description>&lt;h2 id=&#34;preface&#34;&gt;&#xA;  Preface&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#preface&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Frankly, I did not expect to have another blog post so soon after &lt;a href=&#34;https://about.sourcegraph.com/blog/three-years-at-sourcegraph&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;the lengthy one&lt;/a&gt; just one year ago. However, what has happened over the last year at Sourcegraph was huge, some chaos, some excitement, and of course led me to some thinking (which is good).&lt;/p&gt;&#xA;&lt;p&gt;Therefore, I decided to write another blog post focusing on my career learnings and thoughts, as a way of celebrating my fourth anniversary of both working at Sourcegraph and my professional career. Be warned to take my words with a grain of salt, the same way you would interact with ChatGPT.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Three years at Sourcegraph as a software engineer</title>
      <link>https://unknwon.io/posts/220701-three-years-at-sourcegraph/</link>
      <pubDate>Fri, 01 Jul 2022 00:00:00 +0800</pubDate>
      <guid>https://unknwon.io/posts/220701-three-years-at-sourcegraph/</guid>
      <description>&lt;h2 id=&#34;my-story-with-sourcegraph&#34;&gt;&#xA;  My story with Sourcegraph&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#my-story-with-sourcegraph&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;an-email-from-a-random-cool-guy&#34;&gt;&#xA;  An email from a random cool guy&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#an-email-from-a-random-cool-guy&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;The story all started with an email, it was 2013, and I just started learning Go, wrote a website (&lt;a href=&#34;https://github.com/unknwon/gowalker&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;which has been archived&lt;/a&gt; after running it for 9 years) to practice my knowledge, and someone named &amp;ldquo;sqs&amp;rdquo; shot me some lines around &amp;ldquo;Hey, the website you built looks cool, we at Sourcegraph are doing something similar, we should definitely chat.&amp;rdquo; Sorry that I’ve lost that email and couldn’t recall the content exactly.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The mysterious of GTD tools</title>
      <link>https://unknwon.io/posts/220313-the-mysterious-of-gtd-tools/</link>
      <pubDate>Sun, 13 Mar 2022 17:45:00 +0800</pubDate>
      <guid>https://unknwon.io/posts/220313-the-mysterious-of-gtd-tools/</guid>
      <description>&lt;p&gt;&lt;em&gt;Being persistent is better than being clever.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-beginning&#34;&gt;&#xA;  The beginning&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#the-beginning&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Around 2011, I cound’t remember why I installed &lt;a href=&#34;https://www.any.do/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Any.do&lt;/a&gt; from Chrome Web Store but it became the first ToDo app I’ve ever used. It was dead simple, just a list of tasks  with date views like Today, Tomorrow, Upcoming, and Someday. Pretty much the same as what it offers today (just few seconds ago I looked at it).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Write a proposal for open source contributions</title>
      <link>https://unknwon.io/posts/220210-write-a-proposal-for-open-source-contributions/</link>
      <pubDate>Thu, 10 Feb 2022 19:56:00 +0800</pubDate>
      <guid>https://unknwon.io/posts/220210-write-a-proposal-for-open-source-contributions/</guid>
      <description>&lt;p&gt;&lt;em&gt;This blog post is inspired by the conversation of &lt;a href=&#34;https://github.com/gogs/gogs/issues/6715#issuecomment-1008889115&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;adding background repository migration to Gogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-and-when&#34;&gt;&#xA;  Why and when?&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#why-and-when&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Dave Cheney talked about petty much the &amp;ldquo;Why and when&amp;rdquo; parts in his &lt;em&gt;&lt;a href=&#34;https://www.craft.do/s/kyHVs6OoE4Dj5V&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Talk, then code&lt;/a&gt;&lt;/em&gt;, I recommend reading it if you ever want to make a meaningful contribution to an open source project.&lt;/p&gt;&#xA;&lt;p&gt;The more I work in the software engineering field, the more I admire the fact that most of time is and should be spent on articulating and communicating my ideas, both to other people and to my future self. It might seem to have a bit more overhead for always communicating in the beginning (more writing, more talking), but think it as a sort of &amp;ldquo;insurance&amp;rdquo; that a little money you pay, you &amp;ldquo;guarantee&amp;rdquo; (quotas because of reasons) a large pay back in the case of accidents.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Two months after working on the MacBook 14 M1 Pro</title>
      <link>https://unknwon.io/posts/211218-two-months-of-m1-pro/</link>
      <pubDate>Sat, 18 Dec 2021 15:04:00 +0800</pubDate>
      <guid>https://unknwon.io/posts/211218-two-months-of-m1-pro/</guid>
      <description>&lt;p&gt;I did not pay attention to M1-chip MacBooks when they were first being announced in 2020 because I believed it was too cutting-edge and the ecoysystem needs time to catch up, which in hindsight was a right call. In fact, I even made the decision later same year to get a top-tier MacBook Pro 16 with the Intel-chip to upgrade my &lt;a href=&#34;https://unknwon.io/about/#home-office-setup&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;home office setup&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This year, for some reasons, maybe because I got a &lt;a href=&#34;https://www.mi.com/global/mibox/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Mi Box&lt;/a&gt; and watched too many YouTube videos talking about how performant M1-chips are, made me watch the Apple event live, which released stunning new models of MacBook Pro 14-inch and 16-inch. I was super excited for no reason, to be honest, but still pre-ordered the 14-inch base model and &lt;a href=&#34;https://twitter.com/jc_unknwon/status/1452872773290717192&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;got it on the first day of shipping&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Making changes across repositories using Sourcegraph Batch Changes</title>
      <link>https://unknwon.io/posts/211110_sourcegraph_batch_changes/</link>
      <pubDate>Wed, 10 Nov 2021 21:19:00 +0800</pubDate>
      <guid>https://unknwon.io/posts/211110_sourcegraph_batch_changes/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;&#xA;  Background&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#background&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;I had used &amp;ldquo;Sourcegraph Campaigns&amp;rdquo; once that I &lt;a href=&#34;https://github.com/go-macaron/macaron/pull/189&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;migrated all of my personal repositories from Travis CI to GitHub Actions&lt;/a&gt;, which is now branded as &lt;a href=&#34;https://docs.sourcegraph.com/batch_changes&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Sourcegraph Batch Changes&lt;/a&gt;. If this is the first time you heard about it, it is, in my own words, a toolset to create and manage content changes across many, could be dozens if not thousands of repositories.&lt;/p&gt;&#xA;&lt;p&gt;This time, I want to run tests in CI with Go 1.17 for all of &lt;a href=&#34;https://github.com/flamego&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Flamego&lt;/a&gt;&amp;rsquo;s repositories, in addition to Go 1.16 (because Go 1.17 wasn&amp;rsquo;t released at the time).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Joe&#39;s boring methodology to be productive</title>
      <link>https://unknwon.io/posts/211009_boring_methodology_to_be_productive/</link>
      <pubDate>Sat, 09 Oct 2021 18:48:00 +0800</pubDate>
      <guid>https://unknwon.io/posts/211009_boring_methodology_to_be_productive/</guid>
      <description>&lt;p&gt;&lt;em&gt;Crack things before you&amp;rsquo;re feeling ready.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;boring-than-boring&#34;&gt;&#xA;  Boring than boring&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#boring-than-boring&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;It has been a while since I wanted to write down how I do my work, both to share and reflect on my own to seek opportunities for improvement.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m the kind of person that almost always need to designate a purpose to justify the existence of every software I installed, every service I subscribed, and every hardware I bought.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Set up Sourcegraph with two GitLab and Keycloak using SAML</title>
      <link>https://unknwon.io/posts/200915_setup-sourcegraph-gitlab-keycloak/</link>
      <pubDate>Tue, 15 Sep 2020 15:59:00 +0800</pubDate>
      <guid>https://unknwon.io/posts/200915_setup-sourcegraph-gitlab-keycloak/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;&#xA;  Background&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#background&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;I need to set up two GitLab that uses same SSO (Keycloak) and wire up with Sourcegraph to test repository permissions. This is my ops log for doing it.&lt;/p&gt;&#xA;&lt;p&gt;Because both &lt;a href=&#34;https://docs.gitlab.com/ee/integration/saml.html&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;GitLab SAML OmniAuth Provider&lt;/a&gt; and &lt;a href=&#34;https://twitter.com/jc_unknwon/status/1305417765667315712?s=20&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Keycloak&lt;/a&gt; require HTTPS and I&amp;rsquo;m so used to just use &lt;a href=&#34;https://caddyserver.com/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Caddy&lt;/a&gt; to set up such thing with &lt;a href=&#34;https://letsencrypt.org/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Let&amp;rsquo;s Encrypt&lt;/a&gt;, so I create one GCP VM for each GitLab and Keycloak instances and assign them with some subdomains.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a Web Server in Go</title>
      <link>https://unknwon.io/posts/180913_building_a_web_server_in_go/</link>
      <pubDate>Thu, 13 Sep 2018 16:41:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/180913_building_a_web_server_in_go/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;This post was originally published on &lt;a href=&#34;https://thenewstack.io/building-a-web-server-in-go/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://thenewstack.io/building-a-web-server-in-go/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Go (Golang.org) is the system programming language that provides standard HTTP protocol support in its standard library, which makes it easy for developers to build and get a web server running very quickly. Meanwhile, Go offers developers a lot of flexibility. In this post, we lay out several ways to build an HTTP web server in Go and then offer an analysis about how and why these different approaches all work perfectly in Go.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Gogs: Discord, Web Editor and Protected Branches</title>
      <link>https://unknwon.io/posts/170227_gogs-discord-web-editor-and-protected-branches/</link>
      <pubDate>Mon, 27 Feb 2017 16:41:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/170227_gogs-discord-web-editor-and-protected-branches/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;This post is published corresponding to the &lt;a href=&#34;https://gogs.io&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Gogs&lt;/a&gt; &lt;code&gt;0.10&lt;/code&gt; release.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;First things first, you may have noticed there are some notable changes to the branding of Gogs project:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;New logo: great thanks to its designer &lt;a href=&#34;https://twitter.com/egonelbre&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Egon Elbre&lt;/a&gt;. Please also take a look at &lt;a href=&#34;https://github.com/egonelbre/gophers&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;his brilliant art-work of Gophers&lt;/a&gt;, you will love them.&lt;/li&gt;&#xA;&lt;li&gt;Simplified tagline: it is just &lt;strong&gt;Gogs&lt;/strong&gt;, no &lt;em&gt;Go Git Service&lt;/em&gt; anymore (you can still use it if that makes sense to you), and &lt;strong&gt;NOT&lt;/strong&gt; &lt;code&gt;GoGS&lt;/code&gt; (this is 100% wrong!).&lt;/li&gt;&#xA;&lt;li&gt;Twitter handle: it is now &lt;a href=&#34;https://twitter.com/gogshq&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;@GogsHQ&lt;/a&gt;, not &lt;em&gt;@gogitservice&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Official pronunciation: &lt;code&gt;/gɔgs/&lt;/code&gt;, &lt;a href=&#34;translate.google.com&#34; &gt;Google Translate&lt;/a&gt; can pronounce it very similarly (type &lt;code&gt;Gogs&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Great! It has been another year since last release post, around 1.2k commits are added from 140 more contributors, so we now have 322 contributors in total. High-rank features like &lt;strong&gt;web editor&lt;/strong&gt;, &lt;strong&gt;protected branches&lt;/strong&gt;, &lt;strong&gt;IPython Notebook rendering&lt;/strong&gt;, &lt;strong&gt;lable templates&lt;/strong&gt; are also shipping within this release.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Gogs: Pull Request, Wiki and New Design</title>
      <link>https://unknwon.io/posts/151212_gogs-pull-request-wiki-and-new-design/</link>
      <pubDate>Sat, 12 Dec 2015 22:22:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/151212_gogs-pull-request-wiki-and-new-design/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;This post is published corresponding to the &lt;a href=&#34;https://gogs.io&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Gogs - Go Git Service&lt;/a&gt; &lt;code&gt;v0.8.0&lt;/code&gt; release.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;It has been over a year since last release post, mainly because there are too much work undergoing and plans are completely outdated. Fortunately, most of things finally get done in this big release.&lt;/p&gt;&#xA;&lt;p&gt;From last post of release (&lt;code&gt;v0.5.0&lt;/code&gt;), almost 1.8k commits with tons of improvements, bug fixes, new features and others are added to Gogs. Especially top-wanted features like &lt;strong&gt;pull request&lt;/strong&gt;, &lt;strong&gt;repository wiki&lt;/strong&gt; and &lt;strong&gt;builtin SSH server&lt;/strong&gt;. Besides, all pages are now under new Semantic UI theme with &lt;strong&gt;completely redesigned issue tracker&lt;/strong&gt;, and many people have given us positive feedback. The last thing I never forget to mention is Gogs now has 182 contributors from the community.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Setup Gogs with HTTPS</title>
      <link>https://unknwon.io/posts/151115_setup-gogs-with-https/</link>
      <pubDate>Sun, 15 Nov 2015 20:15:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/151115_setup-gogs-with-https/</guid>
      <description>&lt;p&gt;There are two ways to use HTTPS for Gogs based on the way you choose to deploy:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Reverse proxy, e.g. NGINX, Caddy&lt;/li&gt;&#xA;&lt;li&gt;Expose Gogs on the internet directly&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;And there are two types of HTTPS certificates: real and pretend to be real.&lt;/p&gt;&#xA;&lt;p&gt;So, let&amp;rsquo;s talk about how to get your HTTPS certificates.&lt;/p&gt;&#xA;&lt;h3 id=&#34;obtain-https-certificates&#34;&gt;&#xA;  Obtain HTTPS Certificates&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#obtain-https-certificates&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Buy business version (OH PLEASE!!! Donate a million or two to Gogs project 😊)&lt;/li&gt;&#xA;&lt;li&gt;Apply free version from &lt;a href=&#34;https://letsencrypt.org/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Let&amp;rsquo;s Encrypt&lt;/a&gt; or &lt;a href=&#34;https://www.startssl.com/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;StartSSL&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Self-signed&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;You can Google (I just happened to be lazy) about how to get the first two versions of certificates. There are also some tools can generate self-signed certificates, but in this article, I&amp;rsquo;m going to talk about how to use Gogs to generate them.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Organize your teams with Gogs organization</title>
      <link>https://unknwon.io/posts/140913_organize-your-teams-with-gogs-organization/</link>
      <pubDate>Sat, 13 Sep 2014 23:39:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/140913_organize-your-teams-with-gogs-organization/</guid>
      <description>&lt;p&gt;This post is published corresponding to the &lt;a href=&#34;https://github.com/gogits/gogs&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Gogs - Go Git Service&lt;/a&gt; &lt;code&gt;v0.5.0&lt;/code&gt; release.&lt;/p&gt;&#xA;&lt;p&gt;After a whole summer, we finally go from Alpha to Beta with a new release. In this release, we introduced some major features like Organization, Multiple Languages and new UI, and we&amp;rsquo;re receving contributions from more developers which make contributors of Gogs to be 55.&lt;/p&gt;&#xA;&lt;p&gt;Please &lt;a href=&#34;https://github.com/gogits/gogs/releases/tag/v0.5.0&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Change Log&lt;/a&gt; for full list of changes in this release.&lt;/p&gt;&#xA;&lt;p&gt;Strictly speaking, this is a transition release from &lt;code&gt;v0.4.2&lt;/code&gt; to &lt;code&gt;v0.6.0&lt;/code&gt;, and here are the reasons:&lt;/p&gt;</description>
    </item>
    <item>
      <title>GoConvey - Go Testing Package: writing elegant tests</title>
      <link>https://unknwon.io/posts/140831_goconvey-go-testing-package-writing-elegant-tests/</link>
      <pubDate>Sun, 31 Aug 2014 11:55:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/140831_goconvey-go-testing-package-writing-elegant-tests/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;&#xA;  Introduction&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#introduction&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Go comes with built-in unit test feature, and there are lots of third-party helper libraries before GoConvey was born. Unfortunately, none of them can help you write elegant test cases like GoConvey does, simple syntax and comfortable interface make you fall in love with writing unit tests.&lt;/p&gt;&#xA;&lt;h2 id=&#34;installation&#34;&gt;&#xA;  Installation&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#installation&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code&gt;go get github.com/smartystreets/goconvey&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;api-documentation&#34;&gt;&#xA;  API Documentation&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#api-documentation&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Please visit &lt;a href=&#34;http://gowalker.org/github.com/smartystreets/goconvey&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Go Walker&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Setup VIM for Go development</title>
      <link>https://unknwon.io/posts/140704_setup-vim-for-go-development/</link>
      <pubDate>Fri, 04 Jul 2014 18:06:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/140704_setup-vim-for-go-development/</guid>
      <description>&lt;p&gt;This post is for someone like me who just get started with VIM, and because the original plugin author doesn&amp;rsquo;t given detailed steps about how to setup his awesome work, here I am.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;NOTICE&lt;/strong&gt; This is not a post about how to install Go.&lt;/p&gt;&#xA;&lt;p&gt;VIM plugin we use: &lt;a href=&#34;https://github.com/fatih/vim-go&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;github.com/fatih/vim-go&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;install-pathogen&#34;&gt;&#xA;  Install Pathogen&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#install-pathogen&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Pathogen is a plugin manager of VIM, which tons of plugins support it. So, one time forever, let&amp;rsquo;s install it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>XORM - Go ORM: advanced usage</title>
      <link>https://unknwon.io/posts/140616_xorm-go-orm-advanced-usage/</link>
      <pubDate>Mon, 16 Jun 2014 10:59:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/140616_xorm-go-orm-advanced-usage/</guid>
      <description>&lt;h2 id=&#34;transaction&#34;&gt;&#xA;  Transaction&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#transaction&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://gist.github.com/Unknwon/861dfa5107c6e9a65974&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Sample code 1&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;This part is based on last post &lt;a href=&#34;https://unknwon.io/xorm-go-orm-basic-guide/&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;XORM - Go ORM: basic guide&lt;/a&gt; and make some improvements in sample code. In the last post, the transfer part didn&amp;rsquo;t use transcation to make operation safe, and now it is:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Create Session object.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;sess&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;x&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;NewSession&lt;/span&gt;()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;defer&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;sess&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Close&lt;/span&gt;()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Start transcation.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;err&lt;/span&gt; = &lt;span style=&#34;color:#a6e22e&#34;&gt;sess&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Begin&lt;/span&gt;(); &lt;span style=&#34;color:#a6e22e&#34;&gt;err&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;!=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;nil&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;err&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;_&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;err&lt;/span&gt; = &lt;span style=&#34;color:#a6e22e&#34;&gt;sess&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Update&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;a1&lt;/span&gt;); &lt;span style=&#34;color:#a6e22e&#34;&gt;err&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;!=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;nil&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Roll back when error occurs.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;sess&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Rollback&lt;/span&gt;()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;err&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;} &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;_&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;err&lt;/span&gt; = &lt;span style=&#34;color:#a6e22e&#34;&gt;sess&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Update&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;a2&lt;/span&gt;); &lt;span style=&#34;color:#a6e22e&#34;&gt;err&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;!=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;nil&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;sess&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Rollback&lt;/span&gt;()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;err&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Commit transcation.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;sess&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Commit&lt;/span&gt;()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&#xA;&lt;li&gt;First of all, call method &lt;code&gt;x.NewSession&lt;/code&gt; to get a session object, then do not forget use &lt;code&gt;defer&lt;/code&gt; to close it when return.&lt;/li&gt;&#xA;&lt;li&gt;Use method &lt;code&gt;sess.Begin&lt;/code&gt; to tell xorm you are going to make everything after this be in the transcation, and roll back if necessary.&lt;/li&gt;&#xA;&lt;li&gt;Relatively, call method &lt;code&gt;Update&lt;/code&gt; to do update operations. Same thing for inserting, deleting, etc. Just change from &lt;code&gt;xorm.Engine&lt;/code&gt; to &lt;code&gt;xorm.Session&lt;/code&gt;, methods&amp;rsquo; name are the same.&lt;/li&gt;&#xA;&lt;li&gt;Keep in mind that call &lt;code&gt;sess.Rollback&lt;/code&gt; before return statement, this is the key for transcation.&lt;/li&gt;&#xA;&lt;li&gt;Finally, call &lt;code&gt;sess.Commit&lt;/code&gt; to finish the transcation.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;common-functions-and-methods&#34;&gt;&#xA;  Common functions and methods&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#common-functions-and-methods&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://gist.github.com/Unknwon/a7c9162bce3f20d3bee6&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Sample code 2&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Use Gogs to work collaboratively</title>
      <link>https://unknwon.io/posts/140530_use-gogs-to-work-collaboratively/</link>
      <pubDate>Fri, 30 May 2014 02:20:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/140530_use-gogs-to-work-collaboratively/</guid>
      <description>&lt;p&gt;This post is published corresponding to the &lt;a href=&#34;https://github.com/gogits/gogs&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Gogs - Go Git Service&lt;/a&gt; &lt;code&gt;v0.4.1&lt;/code&gt; release.&lt;/p&gt;&#xA;&lt;p&gt;In the very beginning of this post, I want to speak for the develop team say sorry to all Gogs users:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;No matter if you&amp;rsquo;ve ever noticed in Trello board, we&amp;rsquo;re sorry to say that the organization feature didn&amp;rsquo;t implement in this release. This is caused by limited of team members in this period, but we&amp;rsquo;re sure about to provide this feature in 0.5.0.&lt;/p&gt;</description>
    </item>
    <item>
      <title>XORM - Go ORM: basic guide</title>
      <link>https://unknwon.io/posts/140502_xorm-go-orm-basic-guide/</link>
      <pubDate>Fri, 02 May 2014 18:54:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/140502_xorm-go-orm-basic-guide/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;&#xA;  Introduction&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#introduction&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;xorm is a Go ORM which provides rich functionality with very simple APIs. It supports all main stream databases, including MySQL, PostgreSQL, SQLite3 and MsSQL. It allows you use chain operations and combine with raw SQL statements. Moreover, it has session that supports transactions to make your business logic safe.&lt;/p&gt;&#xA;&lt;h2 id=&#34;installation&#34;&gt;&#xA;  Installation&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#installation&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code&gt;go get github.com/go-xorm/xorm&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;api-documentation&#34;&gt;&#xA;  API Documentation&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#api-documentation&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Please visit &lt;a href=&#34;http://gowalker.org/github.com/go-xorm/xorm&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Go Walker&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Setup your private Git hosting with Gogs</title>
      <link>https://unknwon.io/posts/140420_setup-your-private-git-hosting-with-gogs/</link>
      <pubDate>Sun, 20 Apr 2014 15:53:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/140420_setup-your-private-git-hosting-with-gogs/</guid>
      <description>&lt;p&gt;This post is published corresponding to the &lt;a href=&#34;https://github.com/gogs/gogs&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Gogs - Go Git Service&lt;/a&gt; &lt;code&gt;v0.3.0&lt;/code&gt; release.&lt;/p&gt;&#xA;&lt;p&gt;After hard working of more than half of month, Gogs finally gets into a very important release: v0.3.0. There are couple of reasons that why I say this release is important:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;We start receiving advice and feedback from users after first public release, which makes Gogs make more improvements and less bugs.&lt;/li&gt;&#xA;&lt;li&gt;This release adds a lot of new features, including private repository, migrate or mirror repository, ship with Docker, and social account log in.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;a href=&#34;https://github.com/gogs/gogs/graphs/contributors&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;contributors of Gogs&lt;/a&gt; during this release has increased to 17 people, which means Gogs is getting more eyes from other developers.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;If you&amp;rsquo;re interested in how many changes we&amp;rsquo;ve made compare to last release, please see the &lt;a href=&#34;https://github.com/gogs/gogs/releases/tag/v0.3.0&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Change Log&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Gogs: Binary is what called real deployment</title>
      <link>https://unknwon.io/posts/140331_gogs-binary-is-what-called-real-deployment/</link>
      <pubDate>Mon, 31 Mar 2014 22:16:00 -0400</pubDate>
      <guid>https://unknwon.io/posts/140331_gogs-binary-is-what-called-real-deployment/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Great thanks to &lt;a href=&#34;https://twitter.com/bketelsen&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;@bketelsen&lt;/a&gt; for correcting grammar.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;This post is also a guest post on &lt;a href=&#34;http://blog.gopheracademy.com/gogs-v0.2.0&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Gopher Academy Blog&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This post is published corresponding to the &lt;a href=&#34;https://github.com/gogs/gogs&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Gogs - Go Git Service&lt;/a&gt; &lt;code&gt;v0.2.0&lt;/code&gt; release.&lt;/p&gt;&#xA;&lt;p&gt;First, please let me speak for the develop team to thank all of our friends who are supporting us on GitHub. As you may know, &lt;code&gt;v0.2.0&lt;/code&gt; is the first public release of Gogs, and the community has contributed over 650 stars to this project on GitHub in just one week.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
