<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>atotto</author_name>
  <author_url>https://blog.hatena.ne.jp/atotto/</author_url>
  <blog_title>memoメモ</blog_title>
  <blog_url>https://atotto.hatenadiary.jp/</blog_url>
  <categories>
    <anon>golang</anon>
    <anon>memo</anon>
  </categories>
  <description>Go言語の話題です。 コンパイル時にフラグを与えることで、ソースコード上の特定の文字列情報を書き換えることができます。 これを応用すれば、例えば、バージョンやリビジョン番号などの特別な文字列情報を後で指定するといった使い方ができます。 以下、例を書いてみました(version.go)： package main import ( &quot;fmt&quot; ) var version string func main() { fmt.Println(version) } versionの変数が定義されていますが、情報を持っていません。 ここで： $ go build -ldflags &quot;-X main.ver…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fatotto.hatenadiary.jp%2Fentry%2F2013%2F08%2F22%2F212439&quot; title=&quot;コンパイル時に特別な文字列情報を入れるには #golang - memoメモ&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>http://ecx.images-amazon.com/images/I/51OBTgJsC3L.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-08-22 21:24:39</published>
  <title>コンパイル時に特別な文字列情報を入れるには #golang</title>
  <type>rich</type>
  <url>https://atotto.hatenadiary.jp/entry/2013/08/22/212439</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
