<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>podhmo</author_name>
  <author_url>https://blog.hatena.ne.jp/podhmo/</author_url>
  <blog_title>podhmo's diary</blog_title>
  <blog_url>https://pod.hatenablog.com/</blog_url>
  <categories>
    <anon>golang</anon>
    <anon>ast</anon>
    <anon>memo</anon>
  </categories>
  <description>*ast.File からファイル名を取得したい goのファイルのimportなどの情報を取得するのに、直接 go/* のpackageを使うよりも golang.org/x/tools/go/loader を使うのが手軽。 pkgname := &quot;golang.org/x/tools/refactor/rename&quot; c := loader.Config{} c.Import(pkgname) prog, _ := c.Load() // これでrename packageに関する情報がいい感じに取得できる pkginfo := prog.Package(pkgname) (defaultでは…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpod.hatenablog.com%2Fentry%2F2018%2F03%2F05%2F070458&quot; title=&quot;goのast.Fileからファイル名を取得する方法 - podhmo&amp;#39;s diary&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>2018-03-05 07:08:53</published>
  <title>goのast.Fileからファイル名を取得する方法</title>
  <type>rich</type>
  <url>https://pod.hatenablog.com/entry/2018/03/05/070458</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
