<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ema_hiro</author_name>
  <author_url>https://blog.hatena.ne.jp/ema_hiro/</author_url>
  <blog_title>emahiro/b.log</blog_title>
  <blog_url>https://ema-hiro.hatenablog.com/</blog_url>
  <categories>
    <anon>Go</anon>
  </categories>
  <description>Overview golang.org/x/exp/slices を使って重複削除の実装を書く ベンチマークしてみる まとめ Overview Go でスライスの重複処理を実装するのに Generics が使えるので実際に実装してみました。 なお、Go1.18 以前の世界ではスライスの重複を削除するには map と空の struct を使って以下のように実装する必要がありました。 ema-hiro.hatenablog.com なお、for を1回で実装するなら以下のようになります。 arr := [string]{&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;a&quot;} m := make(map[strin…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fema-hiro.hatenablog.com%2Fentry%2F2022%2F03%2F31%2F004349&quot; title=&quot;Go1.18 の Generics を使って Slice の重複削除の処理を書く - emahiro/b.log&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-03-31 00:43:49</published>
  <title>Go1.18 の Generics を使って Slice の重複削除の処理を書く</title>
  <type>rich</type>
  <url>https://ema-hiro.hatenablog.com/entry/2022/03/31/004349</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
