<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Golang on</title><link>https://www.ardanlabs.com/categories/golang/</link><description>Recent content in Golang on</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 20 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.ardanlabs.com/categories/golang/index.xml" rel="self" type="application/rss+xml"/><item><title>RAG in Go: A Vulnerability Research Tool</title><link>https://www.ardanlabs.com/blog/2026/04/rag-in-go-a-vulnerability-research-tool/</link><pubDate>Mon, 20 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.ardanlabs.com/blog/2026/04/rag-in-go-a-vulnerability-research-tool/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;&#10;&lt;p&gt;In &lt;a href="https://www.ardanlabs.com/blog/2026/03/using-tools-a-meeting-scheduler/"&gt;the previous post&lt;/a&gt;, you saw how you can use tools to add information to an LLM query. In this post, we&amp;rsquo;ll see another method of adding information to an LLM called &lt;a href="https://en.wikipedia.org/wiki/Retrieval-augmented_generation"&gt;RAG&lt;/a&gt;, or Retrieval-Augmented Generation.&lt;/p&gt;&#10;&lt;p&gt;The idea of RAG is that you want the LLM to have access to information that wasn&amp;rsquo;t available to it when it was initially trained. You do it by storing documents in your own database along with their &lt;a href="https://en.wikipedia.org/wiki/Embedding_(machine_learning)"&gt;embedding&lt;/a&gt;. I won&amp;rsquo;t go into the technical details of embedding, but think of it as a way to convert a piece of text into a &lt;a href="https://en.wikipedia.org/wiki/Vector"&gt;vector&lt;/a&gt;. The magic is that if two pieces of text have similar meaning, an embedding model can create vectors that mathematically show they are similar.&lt;/p&gt;</description></item><item><title>Using Tools: A Meeting Scheduler</title><link>https://www.ardanlabs.com/blog/2026/03/using-tools-a-meeting-scheduler/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.ardanlabs.com/blog/2026/03/using-tools-a-meeting-scheduler/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;&#10;&lt;p&gt;LLMs are great, but they are trained on public data sets. In some cases, you need the LLM to use data that&amp;rsquo;s not publicly available or that&amp;rsquo;s frequently changing. There are several ways to make such data available to LLMs:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Tool/function calls&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Retrieval-augmented_generation"&gt;Retrieval-augmented generation&lt;/a&gt; (aka RAG)&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Model_Context_Protocol"&gt;MCP&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;In coding agents, you can also add skills.&lt;/p&gt;&#10;&lt;p&gt;In this post we&amp;rsquo;ll focus on function calling.&lt;/p&gt;&#10;&lt;h3 id="how-does-it-work"&gt;How Does It Work?&lt;/h3&gt;&#10;&lt;p&gt;When interacting with an LLM, you can provide a description of available tools if the model supports tool calling.&#10;If the LLM reasons that the best answer is to use one of the tools, it will return a reply that contains a tool call with the parameters to use. Then you make the function call and return the answer back to the LLM.&lt;/p&gt;</description></item><item><title>Query Database Using Plain English</title><link>https://www.ardanlabs.com/blog/2026/02/query-database-using-plain-english/</link><pubDate>Wed, 11 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.ardanlabs.com/blog/2026/02/query-database-using-plain-english/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;&#10;&lt;p&gt;In this post you&amp;rsquo;ll see how you can create a system that allows users to query a relational database using plain English. This allows users not familiar with SQL or business intelligence systems to get insights from data.&lt;/p&gt;&#10;&lt;h3 id="setting-up"&gt;Setting Up&lt;/h3&gt;&#10;&lt;p&gt;If you want to follow along, you&amp;rsquo;ll need to clone the code from &lt;a href="https://github.com/353words/llm-sql"&gt;the GitHub repo&lt;/a&gt;. This will download the code, and the database file containing the data (&lt;code&gt;bikes.ddb&lt;/code&gt;)&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Note: The data is from the &lt;a href="https://www.kaggle.com/datasets/jboysen/austin-bike"&gt;Austin Bike Share dataset&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>JSON - The Fine Print: Part 3 - Zero vs Missing Values</title><link>https://www.ardanlabs.com/blog/2025/05/json-the-fine-print-part-3.html</link><pubDate>Mon, 19 May 2025 00:00:00 +0000</pubDate><guid>https://www.ardanlabs.com/blog/2025/05/json-the-fine-print-part-3.html</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;&#10;&lt;p&gt;In &lt;a href="https://www.ardanlabs.com/blog/2024/10/json-the-fine-print-part-1.html"&gt;part 1&lt;/a&gt; we took a higher level view on serialization in general and JSON in specific.&#10;In &lt;a href="https://www.ardanlabs.com/blog/2024/10/json-the-fine-print-part-2.html"&gt;part 2&lt;/a&gt; we looked at emitting JSON.&lt;/p&gt;&#10;&lt;p&gt;In part 3, we&amp;rsquo;ll look at an issue you might encounter when consuming JSON, Zero vs NULL field values. To clarify the definition of NULL, this means the absence of value.&lt;/p&gt;&#10;&lt;p&gt;So here is the question:&lt;/p&gt;&#10;&lt;p&gt;Given a field in a Go struct set to its zero value, how do you know that zero value was set by the user or it&amp;rsquo;s zero because it was never provided?&lt;/p&gt;</description></item><item><title>JSON - The Fine Print: Part 2 - Emitting JSON</title><link>https://www.ardanlabs.com/blog/2024/10/json-the-fine-print-part-2.html</link><pubDate>Tue, 04 Feb 2025 00:00:00 +0000</pubDate><guid>https://www.ardanlabs.com/blog/2024/10/json-the-fine-print-part-2.html</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;&#10;&lt;p&gt;In &lt;a href="https://www.ardanlabs.com/blog/2024/10/json-the-fine-print-part-1.html"&gt;part 1&lt;/a&gt; we took a high-level view on serialization and JSON. In this part, we&amp;rsquo;ll roll our sleeves and start working with JSON, focused on emitting JSON. You might think this is a basic topic, but there is much more to it than just calling &lt;code&gt;json.Marshal&lt;/code&gt;.&lt;/p&gt;&#10;&lt;h3 id="jsonmarshal-vs-jsonencoder"&gt;&lt;code&gt;json.Marshal&lt;/code&gt; vs &lt;code&gt;json.Encoder&lt;/code&gt;&lt;/h3&gt;&#10;&lt;p&gt;The &lt;code&gt;encoding/json&lt;/code&gt; package has two main APIs: &lt;code&gt;Marshal&lt;/code&gt; and &lt;code&gt;NewEncoder&lt;/code&gt;. The &lt;code&gt;Marshal&lt;/code&gt; function returns a &lt;code&gt;[]byte&lt;/code&gt; while the &lt;code&gt;NewEncoder&lt;/code&gt; function will write to an &lt;code&gt;io.Writer&lt;/code&gt;. The question is: When should you use one API over the other?&lt;/p&gt;</description></item><item><title>JSON - The Fine Print: Part 1</title><link>https://www.ardanlabs.com/blog/2024/10/json-the-fine-print-part-1.html</link><pubDate>Wed, 23 Oct 2024 00:00:00 +0000</pubDate><guid>https://www.ardanlabs.com/blog/2024/10/json-the-fine-print-part-1.html</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;&#10;&lt;p&gt;Everybody knows &lt;a href="https://www.json.org/"&gt;JSON&lt;/a&gt;, it&amp;rsquo;s a simple serialization format and the default format for REST APIs. Like many other topics, there are fine points you should know in order to work with JSON more effectively and avoid common mistakes.&lt;/p&gt;&#10;&lt;p&gt;In this article we&amp;rsquo;ll explore some big picture aspects and some low level details of using JSON.&lt;/p&gt;&#10;&lt;h3 id="serialization"&gt;Serialization&lt;/h3&gt;&#10;&lt;p&gt;Before diving into JSON, I&amp;rsquo;d like to take a look at serialization in general and discuss common mistakes I&amp;rsquo;ve seen my customers make.&lt;/p&gt;</description></item></channel></rss>