<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Go 1.21 on Nalar</title>
    <link>https://nalar.dev/tags/go-1.21/</link>
    <description>Recent content in Go 1.21 on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 10 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/go-1.21/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Find the First Matching Slice Element in Go with slices.IndexFunc</title>
      <link>https://nalar.dev/find-the-first-matching-slice-element-with-slices-indexfunc/</link>
      <pubDate>Thu, 10 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/find-the-first-matching-slice-element-with-slices-indexfunc/</guid>
      <description>&lt;p&gt;Searching a slice is easy when the element itself is comparable and you already know the exact value. Real programs often need something slightly different: the first queued job, the first expired token, or the first record whose normalized name matches some input.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;slices.IndexFunc&lt;/code&gt; handles that case directly. You provide a predicate, and it returns the index of the first element for which that predicate is true. If nothing matches, it returns &lt;code&gt;-1&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
