<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>chidakiyo</author_name>
  <author_url>https://blog.hatena.ne.jp/chidakiyo/</author_url>
  <blog_title>寝ても覚めてもこんぴうた</blog_title>
  <blog_url>https://chidakiyo.hatenablog.com/</blog_url>
  <categories>
    <anon>golang</anon>
  </categories>
  <description>Javaで育った私としては、前方一致/後方一致は StartsWith/EndWith というイメージが勝手にありますが、 goを書いているとたまにど忘れするので備忘録。 go での前方一致/後方一致 goでももちろん前方一致/後方一致のための関数は用意されています。 stringsパッケージの HasPrefix/HasSuffix がそれです。 もうほぼこれで答えなんですが、サンプルは以下のようになります。 import &quot;strings&quot; ~~snip~~ strings.HasPrefix(&quot;hello world&quot;, &quot;hello&quot;) // -&gt; true strings.HasSu…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchidakiyo.hatenablog.com%2Fentry%2Fgo-start-end-with&quot; title=&quot;Go で StartsWith/EndWith、前方一致/後方一致はないの？ - 寝ても覚めてもこんぴうた&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>https://cdn-ak.f.st-hatena.com/images/fotolife/c/chidakiyo/20190815/20190815155700.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-08-19 09:30:00</published>
  <title>Go で StartsWith/EndWith、前方一致/後方一致はないの？</title>
  <type>rich</type>
  <url>https://chidakiyo.hatenablog.com/entry/go-start-end-with</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
