<?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 タイトルの通りです。 Go で文字列の中に改行コードが含まれていた場合 &quot;&quot; なら \\n のようにバックスラッシュを使ってエスケープしますが、そもそもの改行コードを含む文字列をバッククオートで出力した場合、自動で改行コードがエスケープされる、という挙動について fmt の使い方でハマるところがあったので備忘録。 改行コードをエスケープする シンプルなエスケープは以下 func main() { s := &quot;ハロー\\n私は太郎です。&quot; str := fmt.Sprintf(&quot;%s&quot;, s) fmt.Println(str) } // Output: ハロー\n私は太郎です。…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fema-hiro.hatenablog.com%2Fentry%2F2021%2F07%2F29%2F033459&quot; title=&quot;fmt.Fprintf で ``(バッククオート)で囲った文字列をformatしたときにハマった話 - 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>2021-07-29 03:34:59</published>
  <title>fmt.Fprintf で ``(バッククオート)で囲った文字列をformatしたときにハマった話</title>
  <type>rich</type>
  <url>https://ema-hiro.hatenablog.com/entry/2021/07/29/033459</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
