<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Copying on Nalar</title>
    <link>https://nalar.dev/tags/copying/</link>
    <description>Recent content in Copying on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 11 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/copying/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Copy Go Slices with slices.Clone</title>
      <link>https://nalar.dev/copy-go-slices-with-slices-clone/</link>
      <pubDate>Fri, 11 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/copy-go-slices-with-slices-clone/</guid>
      <description>&lt;p&gt;A slice assignment copies the slice header, not its backing array. That detail becomes visible as soon as one variable changes an element and another variable unexpectedly sees the same change. &lt;code&gt;slices.Clone&lt;/code&gt; gives the copied slice separate element storage with a single call.&lt;/p&gt;&#xA;&lt;p&gt;The copy is shallow. That makes it a clean fit for slices of numbers, strings, and value-only structs, but nested maps, slices, pointers, and other reference-like values still need deliberate handling.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
