<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>go-redis guide (Go) on Docs</title>
    <link>https://redis.io/docs/latest/develop/clients/go/</link>
    <description>Recent content in go-redis guide (Go) on Docs</description>
    <generator>Hugo</generator>
    <language>en</language>
    <atom:link href="https://redis.io/docs/latest/develop/clients/go/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Connect to the server</title>
      <link>https://redis.io/docs/latest/develop/clients/go/connect/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/go/connect/</guid>
      <description>&lt;h2 id=&#34;basic-connection&#34; class=&#34;group relative&#34;&gt;&#xA;  Basic connection&#xA;  &lt;a href=&#34;#basic-connection&#34; class=&#34;header-link opacity-0 group-hover:opacity-100 transition-opacity duration-200 ml-1 align-baseline&#34; aria-label=&#34;Link to this section&#34; title=&#34;Copy link to clipboard&#34;&gt;&#xA;    &lt;svg class=&#34;inline-block w-4 h-4 align-baseline&#34; fill=&#34;currentColor&#34; viewBox=&#34;0 0 20 20&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;      &lt;path fill-rule=&#34;evenodd&#34; d=&#34;M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z&#34; clip-rule=&#34;evenodd&#34;&gt;&lt;/path&gt;&#xA;    &lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The following example shows the simplest way to connect to a Redis server:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Connect to Azure Managed Redis</title>
      <link>https://redis.io/docs/latest/develop/clients/go/amr/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/go/amr/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;https://github.com/redis/go-redis-entraid&#34;&gt;&lt;code&gt;go-redis-entraid&lt;/code&gt;&lt;/a&gt; package&#xA;lets you authenticate your app to&#xA;&lt;a href=&#34;https://azure.microsoft.com/en-us/products/managed-redis&#34;&gt;Azure Managed Redis (AMR)&lt;/a&gt;&#xA;using &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity/&#34;&gt;Microsoft Entra ID&lt;/a&gt;.&#xA;You can authenticate using a system-assigned or user-assigned&#xA;&lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview&#34;&gt;managed identity&lt;/a&gt;&#xA;or a &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity-platform/app-objects-and-service-principals&#34;&gt;service principal&lt;/a&gt;,&#xA;letting &lt;code&gt;go-redis-entraid&lt;/code&gt; fetch and renew the authentication tokens for you automatically.&lt;/p&gt;&#xA;&lt;h2 id=&#34;install&#34; class=&#34;group relative&#34;&gt;&#xA;  Install&#xA;  &lt;a href=&#34;#install&#34; class=&#34;header-link opacity-0 group-hover:opacity-100 transition-opacity duration-200 ml-1 align-baseline&#34; aria-label=&#34;Link to this section&#34; title=&#34;Copy link to clipboard&#34;&gt;&#xA;    &lt;svg class=&#34;inline-block w-4 h-4 align-baseline&#34; fill=&#34;currentColor&#34; viewBox=&#34;0 0 20 20&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;      &lt;path fill-rule=&#34;evenodd&#34; d=&#34;M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z&#34; clip-rule=&#34;evenodd&#34;&gt;&lt;/path&gt;&#xA;    &lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Install &lt;a href=&#34;https://redis.io/docs/latest/develop/clients/go/&#34;&gt;&lt;code&gt;go-redis&lt;/code&gt;&lt;/a&gt; if you&#xA;have not already done so. Note that &lt;code&gt;go-redis-entraid&lt;/code&gt;&#xA;requires &lt;code&gt;go-redis&lt;/code&gt; v9.9.0 or above, so you should upgrade if you&#xA;are using an earlier version.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Index and query documents</title>
      <link>https://redis.io/docs/latest/develop/clients/go/queryjson/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/go/queryjson/</guid>
      <description>&lt;p&gt;This example shows how to create a&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/search-and-query/indexing/&#34;&gt;search index&lt;/a&gt;&#xA;for &lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/json/&#34;&gt;JSON&lt;/a&gt; documents and&#xA;run queries against the index. It then goes on to show the slight differences&#xA;in the equivalent code for &lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/hashes/&#34;&gt;hash&lt;/a&gt;&#xA;documents.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;alert p-3 relative flex flex-row flex-wrap items-center text-base bg-redis-pencil-200 rounded-md&#34;&gt;&#xA;  &lt;div class=&#34;p-2 pr-5&#34;&gt;&lt;svg width=&#34;21&#34; height=&#34;21&#34; viewBox=&#34;0 0 21 21&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;  &lt;circle cx=&#34;10.5&#34; cy=&#34;10.5&#34; r=&#34;9.75&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;1.5&#34;/&gt;&#xA;  &lt;path d=&#34;M10.5 14V16&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34;/&gt;&#xA;  &lt;path d=&#34;M10.5 5V12&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34;/&gt;&#xA;&lt;/svg&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;div class=&#34;p-1 pl-4 sm:pl-6 border-l border-l-redis-ink-900 border-opacity-50 flex-1&#34;&gt;&#xA;  &#xA;  &lt;div class=&#34;font-medium&#34;&gt;Note:&lt;/div&gt;&#xA;  From &lt;a href=&#34;https://github.com/redis/go-redis/releases/tag/v9.8.0&#34;&gt;v9.8.0&lt;/a&gt; onwards,&#xA;&lt;code&gt;go-redis&lt;/code&gt; uses query dialect 2 by default.&#xA;Redis query engine methods such as &lt;a href=&#34;https://redis.io/docs/latest/commands/ft.search/&#34;&gt;&lt;code&gt;FTSearch()&lt;/code&gt;&lt;/a&gt;&#xA;will explicitly request this dialect, overriding the default set for the server.&#xA;See&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/dialects/&#34;&gt;Query dialects&lt;/a&gt;&#xA;for more information.&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;h2 id=&#34;initialize&#34; class=&#34;group relative&#34;&gt;&#xA;  Initialize&#xA;  &lt;a href=&#34;#initialize&#34; class=&#34;header-link opacity-0 group-hover:opacity-100 transition-opacity duration-200 ml-1 align-baseline&#34; aria-label=&#34;Link to this section&#34; title=&#34;Copy link to clipboard&#34;&gt;&#xA;    &lt;svg class=&#34;inline-block w-4 h-4 align-baseline&#34; fill=&#34;currentColor&#34; viewBox=&#34;0 0 20 20&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;      &lt;path fill-rule=&#34;evenodd&#34; d=&#34;M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z&#34; clip-rule=&#34;evenodd&#34;&gt;&lt;/path&gt;&#xA;    &lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Make sure that you have &lt;a href=&#34;https://redis.io/docs/latest/operate/oss_and_stack/&#34;&gt;Redis Open Source&lt;/a&gt;&#xA;or another Redis server available. Also install the&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/clients/go/&#34;&gt;&lt;code&gt;go-redis&lt;/code&gt;&lt;/a&gt; client library if you&#xA;haven&#39;t already done so.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Index and query vectors</title>
      <link>https://redis.io/docs/latest/develop/clients/go/vecsearch/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/go/vecsearch/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/search-and-query/&#34;&gt;Redis Query Engine&lt;/a&gt;&#xA;lets you index vector fields in &lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/hashes/&#34;&gt;hash&lt;/a&gt;&#xA;or &lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/json/&#34;&gt;JSON&lt;/a&gt; objects (see the&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/search-and-query/vectors/&#34;&gt;Vectors&lt;/a&gt;&#xA;reference page for more information).&#xA;Among other things, vector fields can store &lt;em&gt;text embeddings&lt;/em&gt;, which are AI-generated vector&#xA;representations of the semantic information in pieces of text. The&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/search-and-query/vectors/#distance-metrics&#34;&gt;vector distance&lt;/a&gt;&#xA;between two embeddings indicates how similar they are semantically. By comparing the&#xA;similarity of an embedding generated from some query text with embeddings stored in hash&#xA;or JSON fields, Redis can retrieve documents that closely match the query in terms&#xA;of their meaning.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Vector set embeddings</title>
      <link>https://redis.io/docs/latest/develop/clients/go/vecsets/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/go/vecsets/</guid>
      <description>&lt;p&gt;A Redis &lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/vector-sets/&#34;&gt;vector set&lt;/a&gt; lets&#xA;you store a set of unique keys, each with its own associated vector.&#xA;You can then retrieve keys from the set according to the similarity between&#xA;their stored vectors and a query vector that you specify.&lt;/p&gt;&#xA;&lt;p&gt;You can use vector sets to store any type of numeric vector but they are&#xA;particularly optimized to work with text embedding vectors (see&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/&#34;&gt;Redis for AI&lt;/a&gt; to learn more about text&#xA;embeddings). The example below shows how to use the&#xA;&lt;a href=&#34;https://github.com/knights-analytics/hugot&#34;&gt;&lt;code&gt;Hugot&lt;/code&gt;&lt;/a&gt;&#xA;library to generate vector embeddings and then&#xA;store and retrieve them using a vector set with &lt;code&gt;go-redis&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Pipelines and transactions</title>
      <link>https://redis.io/docs/latest/develop/clients/go/transpipe/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/go/transpipe/</guid>
      <description>&lt;p&gt;Redis lets you send a sequence of commands to the server together in a batch.&#xA;There are two types of batch that you can use:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Pipelines&lt;/strong&gt; avoid network and processing overhead by sending several commands&#xA;to the server together in a single communication. The server then sends back&#xA;a single communication with all the responses. See the&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/using-commands/pipelining/&#34;&gt;Pipelining&lt;/a&gt; page for more&#xA;information.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Transactions&lt;/strong&gt; guarantee that all the included commands will execute&#xA;to completion without being interrupted by commands from other clients.&#xA;See the &lt;a href=&#34;https://redis.io/docs/latest/develop/using-commands/transactions/&#34;&gt;Transactions&lt;/a&gt;&#xA;page for more information.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;execute-a-pipeline&#34; class=&#34;group relative&#34;&gt;&#xA;  Execute a pipeline&#xA;  &lt;a href=&#34;#execute-a-pipeline&#34; class=&#34;header-link opacity-0 group-hover:opacity-100 transition-opacity duration-200 ml-1 align-baseline&#34; aria-label=&#34;Link to this section&#34; title=&#34;Copy link to clipboard&#34;&gt;&#xA;    &lt;svg class=&#34;inline-block w-4 h-4 align-baseline&#34; fill=&#34;currentColor&#34; viewBox=&#34;0 0 20 20&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;      &lt;path fill-rule=&#34;evenodd&#34; d=&#34;M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z&#34; clip-rule=&#34;evenodd&#34;&gt;&lt;/path&gt;&#xA;    &lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;To execute commands in a pipeline, you first create a pipeline object&#xA;and then add commands to it using methods that resemble the standard&#xA;command methods (for example, &lt;code&gt;Set()&lt;/code&gt; and &lt;code&gt;Get()&lt;/code&gt;). The commands are&#xA;buffered in the pipeline and only execute when you call the &lt;code&gt;Exec()&lt;/code&gt;&#xA;method on the pipeline object.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Probabilistic data types</title>
      <link>https://redis.io/docs/latest/develop/clients/go/prob/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/go/prob/</guid>
      <description>&lt;p&gt;Redis supports several&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/probabilistic/&#34;&gt;probabilistic data types&lt;/a&gt;&#xA;that let you calculate values approximately rather than exactly.&#xA;The types fall into two basic categories:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#set-operations&#34;&gt;Set operations&lt;/a&gt;: These types let you calculate (approximately)&#xA;the number of items in a set of distinct values, and whether or not a given value is&#xA;a member of a set.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#statistics&#34;&gt;Statistics&lt;/a&gt;: These types give you an approximation of&#xA;statistics such as the quantiles, ranks, and frequencies of numeric data points in&#xA;a list.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;To see why these approximate calculations would be useful, consider the task of&#xA;counting the number of distinct IP addresses that access a website in one day.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Error handling</title>
      <link>https://redis.io/docs/latest/develop/clients/go/error-handling/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/go/error-handling/</guid>
      <description>&lt;p&gt;go-redis uses &lt;strong&gt;explicit error returns&lt;/strong&gt; following Go&#39;s idiomatic error handling pattern. Code examples in the documentation often omit error handling for brevity,&#xA;but it is essential in production code.&#xA;This page explains how go-redis&#39;s error handling works and how to apply&#xA;some common error handling patterns. For an overview of error types and handling&#xA;strategies, see &lt;a href=&#34;https://redis.io/docs/latest/develop/clients/error-handling/&#34;&gt;Error handling&lt;/a&gt;.&#xA;See also &lt;a href=&#34;https://redis.io/docs/latest/develop/clients/go/produsage/&#34;&gt;Production usage&lt;/a&gt;&#xA;for more information on connection management, timeouts, and other aspects of&#xA;app reliability.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Production usage</title>
      <link>https://redis.io/docs/latest/develop/clients/go/produsage/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/go/produsage/</guid>
      <description>&lt;p&gt;This guide offers recommendations to get the best reliability and&#xA;performance in your production environment.&lt;/p&gt;&#xA;&lt;h2 id=&#34;checklist&#34; class=&#34;group relative&#34;&gt;&#xA;  Checklist&#xA;  &lt;a href=&#34;#checklist&#34; class=&#34;header-link opacity-0 group-hover:opacity-100 transition-opacity duration-200 ml-1 align-baseline&#34; aria-label=&#34;Link to this section&#34; title=&#34;Copy link to clipboard&#34;&gt;&#xA;    &lt;svg class=&#34;inline-block w-4 h-4 align-baseline&#34; fill=&#34;currentColor&#34; viewBox=&#34;0 0 20 20&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;      &lt;path fill-rule=&#34;evenodd&#34; d=&#34;M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z&#34; clip-rule=&#34;evenodd&#34;&gt;&lt;/path&gt;&#xA;    &lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Each item in the checklist below links to the section&#xA;for a recommendation. Use the checklist icons to record your&#xA;progress in implementing the recommendations.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
