Upgrade to Pro — share decks privately, control downloads, hide ads and more …

サクッと作る静的解析ツール_importの依存制御ツールを作る_

 サクッと作る静的解析ツール_importの依存制御ツールを作る_

More Decks by 株式会社ビットキー / Bitkey Inc.

Other Decks in Technology

Transcript

  1. Bitkey Inc. Connect Product Noriki Takahashi αΫοͱ࡞Δ੩తղੳπʔϧ -import ͷґଘ੍ޚπʔϧΛ࡞Δ-

  2. Outline 2 2 1. ࣗݾ঺հ 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ 3. ਽ܗੜ੒πʔϧ: skeleton

    4. ੩తղੳ༻ύοέʔδ: analysis 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 6. ·ͱΊ
  3. 1. ࣗݾ঺հ 3 • ∁ڮయੜ(Noriki Takahashi) ◦ Twitter: @norinoriki0 ◦

    GitHub: nrnrk • גࣜձࣾBitkey ◦ bitkey platform ͱ͍͏"ΧΪ"ͷϓϥοτϑΥʔϜͷ։ൃ • Go Ͱ GKE ্Ͱಈ͘APIαʔόʔͷ։ൃͳͲΛ͍ͯ͠·͢ • झຯ: ਺ֶɾ෺ཧֶ ◦ zk-SNARKs ͷ਺ֶతͳଆ໘ΛטΈࡅ͘هࣄΛॻ͍ͨΓͯ͠·͢
  4. 1. ࣗݾ঺հ 4 • ∁ڮయੜ(Noriki Takahashi) ◦ Twitter: @norinoriki0 ◦

    GitHub: nrnrk • גࣜձࣾBitkey ◦ bitkey platform ͱ͍͏"ΧΪ"ͷϓϥοτϑΥʔϜͷ։ൃ • Go Ͱ GKE ্Ͱಈ͘APIαʔόʔͷ։ൃͳͲΛ͍ͯ͠·͢ • झຯ: ਺ֶɾ෺ཧֶ ◦ zk-SNARKs ͷ਺ֶతͳଆ໘ΛטΈࡅ͘هࣄΛॻ͍ͨΓͯ͠·͢
  5. 1. ࣗݾ঺հ 5

  6. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ 6 6

  7. 7 7 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ

  8. 8 8 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ go.mod ϑΝΠϧ΋ϨϙδτϦʹҰͭ →

    Go Module ͕1ͭͷϞϊϨϙ
  9. 9 9 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ͍ΘΏΔϥΠϒϥϦ ؔ਺΍ߏ଄ମͳͲ͕ೖ͍ͬͯΔ ϞϊϨϙ಺ͷଞͷύοέʔδ͔Βར༻͞ΕΔ͜

    ͱΛ૝ఆ
  10. 10 10 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ֤छαʔϏε HTTPαʔόʔ΍gRPCαʔόʔͳͲ ଞ͔Β

    import ͞Εͯ΄͘͠ͳ͍
  11. 11 11 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ࠔΔ͜ͱ ҙਤ͠ͳ͍ґଘ͕͋ͬͯ΋Ϗϧυ͕௨Δ ྫ:

    serviceB → serviceA
  12. 12 12 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ղܾํ๏͸͍͔ͭ͋͘Δ

  13. 13 13 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ղܾํ๏ᶃ internal ύοέʔδΛར༻

    serviceA,B,C ͦΕͧΕͷύοέʔδ಺Ͱެ։͠ ͨ͘ͳ͍ύοέʔδ͸ internal ͷதʹೖΕΔ
  14. 14 14 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ղܾํ๏ᶃ internal ύοέʔδΛར༻

    serviceA,B,C ͦΕͧΕͷύοέʔδ಺Ͱެ։͠ ͨ͘ͳ͍ύοέʔδ͸ internal ͷதʹೖΕΔ → ڞ௨ར༻͢Δ΋ͷ͸ϥΠϒϥϦͱͯ͠੾Γ ग़͢ͷͰɺશ෦ internal ͷதʹೖΕΔ͜ͱʹ...
  15. 15 15 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ղܾํ๏ᶄ Go Module

    ͷ෼ׂ serviceA,B,C ҎԼʹ go.mod Λ͓͍ͯผͷϞ δϡʔϧͱΈͳ͢
  16. 16 16 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ղܾํ๏ᶄ Go Module

    ͷ෼ׂ serviceA,B,C ҎԼʹ go.mod Λ͓͍ͯผͷϞ δϡʔϧͱΈͳ͢ → ؅ཧ͕൥ࡶʹͳΔͷͰආ͚͍ͨ
  17. 17 17 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ղܾํ๏ᶃɺᶄ͸ඪ४తͳํ๏͕ͩɺզʑʹ͸ ϑΟοτ͠ͳ͍...

  18. 18 18 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ղܾํ๏ᶅ linter Ͱ੍ޚ

    ύοέʔδؒͷґଘΛνΣοΫͯ͠CIͳͲͰ੍ ޚͰ͖ΔΑ͏ʹ͢Δ
  19. 19 19 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ • Go ͷϞϊϨϙͷҰྫ ղܾํ๏ᶅ linter Ͱ੍ޚ

    ύοέʔδؒͷґଘΛνΣοΫͯ͠CIͳͲͰ੍ ޚͰ͖ΔΑ͏ʹ͢Δ → ͪΐͬͱअಓͬΆ͍͕ɺࠓճ͸͜ΕΛࢼ͢
  20. ґଘੑΛνΣοΫ͢ΔΑ͏ͳ linter Λ୳ͦ͏ 20 20 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ

  21. ͏ʔΜɺɺɺͳ͍ 21 21 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ

  22. ࣗ࡞ linter Ͱ͍͔͘... 22 22 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ

  23. Ͱ΋੩తղੳ͔ɺ ͳΜ͔େมͦ͏ͩͳ 23 23 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ

  24. ͱࢥͬͪΌ͍·ͨ͠ 24 24 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ

  25. ͕ɺ͔͠͠ 25 25 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ

  26. ࣮ࡍʹ΍ͬͯΈΔͱ݁ߏ؆୯ʂ 26 26 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ

  27. skeleton (਽ܗੜ੒πʔϧ)΍ ४ެࣜͷ analysis ύοέʔδͷ ͓͔͛Ͱ؆୯ʹαΫοͱ࡞Εͨ 27 27 2. ϞϊϨϙ։ൃͰؾʹͳΔ͜ͱ

  28. ਽ܗੜ੒πʔϧ: skeleton 28 28

  29. • skeleton Goͷ੩తղੳπʔϧͷͨΊͷ਽ܗΛੜ੒ͯ͘͠ΕΔπʔϧ ԼهίϚϯυͰΠϯετʔϧͰ͖·͢ go install github.com/gostaticanalysis/skeleton/v2@latest 3. ਽ܗੜ੒πʔϧ: skeleton

    29
  30. • skeleton 30 3. ਽ܗੜ੒πʔϧ: skeleton

  31. • skeleton 31 module ໊Λࢦఆͯ͠਽ܗ(εέϧτϯ) Λੜ੒ 3. ਽ܗੜ੒πʔϧ: skeleton

  32. • skeleton 32 ίϚϯυ࣮ߦ༻ͷϩδοΫ ͓ܾ·ΓͷϩδοΫ͕͋Δ 3. ਽ܗੜ੒πʔϧ: skeleton

  33. • skeleton 33 ղੳ༻ͷϩδοΫΛఆٛ ࠷௿ݶ͜͜ʹϩδοΫΛॻ͚ͩ͘Ͱ OK 3. ਽ܗੜ੒πʔϧ: skeleton

  34. • skeleton 34 ୯ମςετ 3. ਽ܗੜ੒πʔϧ: skeleton

  35. • skeleton 35 ୯ମςετ༻ͷσʔλ ੩తղੳͳͷͰ ςετ༻σʔλ = ιʔείʔυ 3. ਽ܗੜ੒πʔϧ:

    skeleton
  36. ੩తղੳ༻ύοέʔδ: analysis 36 36

  37. • analysis ύοέʔδ ◦ ੩తղੳ༻ͷ"४ެࣜ"ύοέʔδ (golang.org/x/tools/go/analysis) ▪ → ੩తղੳʹ͓͚ΔϝΠϯͷϩδοΫ͚ͩʹूதͰ͖Δ 4.

    ੩తղੳ༻ύοέʔδ: analysis 37
  38. • analysis ύοέʔδ ◦ ੩తղੳ༻ͷ"४ެࣜ"ύοέʔδ (golang.org/x/tools/go/analysis) ▪ → ੩తղੳʹ͓͚ΔϝΠϯͷϩδοΫ͚ͩʹूதͰ͖Δ ◦

    ಛ௃ ▪ Analyzer ߏ଄ମͰ੩తղੳͷ݁Ռͷ࠶ར༻͕؆୯ʹ 4. ੩తղੳ༻ύοέʔδ: analysis 38
  39. • analysis ύοέʔδ ◦ ੩తղੳ༻ͷ"४ެࣜ"ύοέʔδ (golang.org/x/tools/go/analysis) ▪ → ੩తղੳʹ͓͚ΔϝΠϯͷϩδοΫ͚ͩʹूதͰ͖Δ ◦

    ಛ௃ ▪ Analyzer ߏ଄ମͰ੩తղੳͷ݁Ռͷ࠶ར༻͕؆୯ʹ ◦ ઌఔͷ skeleton Ͱੜ੒͞ΕͨίʔυͰ࢖ΘΕ͍ͯΔ 4. ੩తղੳ༻ύοέʔδ: analysis 39
  40. • Analyzer ߏ଄ମ(࠶ར༻ͳ͠ͷ࠷΋γϯϓϧͳྫ) 4. ੩తղੳ༻ύοέʔδ: analysis 40 mylinter.go

  41. • Analyzer ߏ଄ମ(࠶ར༻ͳ͠ͷ࠷΋γϯϓϧͳྫ) 4. ੩తղੳ༻ύοέʔδ: analysis 41 analyzer ͷ໊শ (≒

    linter ͷ໊শ) mylinter.go
  42. • Analyzer ߏ଄ମ(࠶ར༻ͳ͠ͷ࠷΋γϯϓϧͳྫ) 4. ੩తղੳ༻ύοέʔδ: analysis 42 υΩϡϝϯτ analyzer ʹ͍ͭͯͷ

    આ໌ mylinter.go
  43. • Analyzer ߏ଄ମ(࠶ར༻ͳ͠ͷ࠷΋γϯϓϧͳྫ) 4. ੩తղੳ༻ύοέʔδ: analysis 43 ղੳ༻ϩδοΫ → ࠷௿ݶɺ͜͜ʹϩ

    δοΫॻ͚ͩ͘Ͱ OK mylinter.go
  44. • Analyzer ߏ଄ମ ͷ࠶ར༻ • Analyzer ߏ଄ମΛఆٛ͢Δࡍʹɺଞͷ Analyzer Λར༻͢Δ͜ͱ͕Ͱ͖Δ 4.

    ੩తղੳ༻ύοέʔδ: analysis 44
  45. • Analyzer ߏ଄ମ ͷ࠶ར༻ • Analyzer ߏ଄ମΛఆٛ͢Δࡍʹɺଞͷ Analyzer Λར༻͢Δ͜ͱ͕Ͱ͖Δ •

    ྫ: golang.org/x/tools/go/analysis/passes/inspect.Analyzer Λ༻͍ͯϊʔ υͷϑΟϧλϦϯά 4. ੩తղੳ༻ύοέʔδ: analysis 45
  46. • Analyzer ߏ଄ମ ͷ࠶ར༻ • Analyzer ߏ଄ମΛఆٛ͢Δࡍʹɺଞͷ Analyzer Λར༻͢Δ͜ͱ͕Ͱ͖Δ •

    ྫ: golang.org/x/tools/go/analysis/passes/inspect.Analyzer Λ༻͍ͯϊʔυ ͷϑΟϧλϦϯά 4. ੩తղੳ༻ύοέʔδ: analysis 46 Analyzer ͷ࠶ར༻ͷ؆୯ͳྫͱͯ͠ɺ ࣝผࢠ͕ "gopher" ͱͳ͍ͬͯΔ΋ͷΛݟ͚ͭΔ࣮૷ྫΛݟͯΈΔ → ࣍ͷεϥΠυ ※ skeleton ͔Βੜ੒͞ΕΔαϯϓϧ
  47. 4. ੩తղੳ༻ύοέʔδ: analysis 47

  48. 4. ੩తղੳ༻ύοέʔδ: analysis 48 mylinter.go

  49. 4. ੩తղੳ༻ύοέʔδ: analysis 49 ࠶ར༻͢Δ Analyzer Λఆٛ ͜͜Ͱ͸ɺAST ݕࠪ༻ ͷ

    Analyzer Λར༻ golang.org/x/tools/go/ analysis/passes/ inspect mylinter.go
  50. 4. ੩తղੳ༻ύοέʔδ: analysis 50 run ͷதͰ inspect.Analyzer ͷग़ ྗ͢Δ݁ՌΛར༻ mylinter.go

  51. 4. ੩తղੳ༻ύοέʔδ: analysis 51 ast.Ident (Identifier = ࣝผࢠ) ͷΈʹߜΔͨ ΊͷϑΟϧλ

    mylinter.go
  52. 4. ੩తղੳ༻ύοέʔδ: analysis 52 inspect Λར༻ͯ͠ ast.Ident ͷΈʹߜͬͯ ॲཧ͢Δ ଞͷ

    AST ͷϊʔυ͕ དྷͨͱ͖ͷॲཧΛॻ͔ ͳͯ͘΋ྑ͍ʂ mylinter.go
  53. 4. ੩తղੳ༻ύοέʔδ: analysis 53 ಠࣗͷϩδοΫ͸͜͜ ͚ͩ analysis ύοέʔδΛ ࢖͏͜ͱͰ͜͜ʹ͚ͩ ूத͢Δ͜ͱ͕Ͱ͖Δ

    mylinter.go
  54. • [༨ஊ] inspect Analyzer ͷఆٛ 4. ੩తղੳ༻ύοέʔδ: analysis 54

  55. • [༨ஊ] inspect Analyzer ͷఆٛ 4. ੩తղੳ༻ύοέʔδ: analysis 55 ͜͜Ͱ࠶ར༻͢Δ݁Ռͷ

    ܕΛఆٛ
  56. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 56 56

  57. • ύοέʔδґଘ੍ޚπʔϧ(banimport)࣮૷ ◦ ࣮ݱ͍ͨ͜͠ͱ ▪ ύοέʔδؒͷґଘΛ੍ޚ͍ͨ͠ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 57

  58. • ύοέʔδґଘ੍ޚπʔϧ(banimport)࣮૷ ◦ ࣮ݱ͍ͨ͜͠ͱ ▪ ύοέʔδؒͷґଘΛ੍ޚ͍ͨ͠ ◦ ࢓༷ ▪ ېࢭ͢Δґଘ͕͋ͬͨΒՕॴΛಛఆͯ͠ΤϥʔΛฦ͢

    ▪ ઃఆϑΝΠϧ (.banimport.json) • ېࢭ͢Δґଘͷjsonఆٛ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 58
  59. • ᶃ skeleton Ͱ਽ܗ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 59

  60. • ᶄ ςετ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 60

  61. • ᶄ ςετ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 61 ςετσʔλ࡞੒ → ࠓճ͸ෳ਺ͷύοέʔδͷґଘؔ܎ ͷςετ͕͍ͨ͠ͷͰߏ੒Λগ͠มߋ

  62. • ᶄ ςετ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 62 ಺෦ʹෳ਺ͷύοέʔδ͕͋Δ͜ͷ ·ͱ·ΓΛҰͭͷσʔληοτͱ͢ Δ

  63. • ᶄ ςετ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 63 ͜Ε͸ svca, svcb, svcc

    ͔Βར༻͞ ΕͯOK
  64. • ᶄ ςετ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 64 ͜͜ͷؒͰ͸ґଘΛ࣋ͨͳ͍Α͏ͳ ϧʔϧʹ͢Δ

  65. • ᶄ ςετ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 65 testdata/src/a/srcb/ main.go testdata/src/a/srcc/main.go

  66. • ᶄ ςετ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 66 svcb → svcc ʹґଘΛ΋͓ͨͤͯ͘

    → ͜Ε͸Τϥʔͱͯ͠ݕग़͢Δ testdata/src/a/srcb/ main.go testdata/src/a/srcc/main.go
  67. • ᶄ ςετ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 67 ίϝϯτͰϝοηʔδͷظ଴஋Λهࡌ // want <͜͜ʹهࡌ>

    ← analysistest ύοέʔδ͕ղऍ testdata/src/a/srcb/ main.go testdata/src/a/srcc/main.go
  68. • ᶄ ςετ࡞੒: ઃఆϑΝΠϧ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 68 ઃఆϑΝΠϧΛ࡞੒ Ͳͷύοέʔδ͔ΒͲͷ ύοέʔδʹґଘΛ࣋ͨͳ

    ͍Α͏ʹ͢Δ͔Λઃఆ .banimport.json
  69. • ᶄ ςετ࡞੒: ઃఆϑΝΠϧ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 69 svca ͔Β svcb,

    sbcc ʹґଘ Λ࣋ͨͳ͍Α͏ʹ͢Δ .banimport.json
  70. • ᶄ ςετ࡞੒: ઃఆϑΝΠϧ࡞੒ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 70 svca, svcb, svcc

    ͸૬ޓʹґ ଘΛ࣋ͬͯ͸͍͚ͳ͍ .banimport.json
  71. • ᶄ ςετ࡞੒: ςετͷ࣮ߦ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 71 ςετͷ࣮ߦ

  72. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 72 banimport_test.g o

  73. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 73 ςετͷσʔληοτΛϧʔϓ (b, c ͷςετσʔλ΋௥Ճ) banimport_test.g o

  74. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 74 analysistest ͷσϑΥϧτͷ testadata ύε banimport_test.g o

  75. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 75 import ͷґଘېࢭͷઃఆϑΝΠϧͷಡΈࠐΈ banimport_test.g o

  76. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 76 import ͷґଘېࢭͷઃఆΛϑϥάͱͯ͠౉͢(࣍ͷᶅ࣮૷ Ͱ঺հ) banimport_test.g o

  77. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 77 ςετσʔλΛࢦఆ࣮ͯ͠ߦ banimport_test.g o

  78. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 78 ςετΛߦ͏ Analyzer Λࢦఆ banimport_test.g o

  79. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 79 ղੳ͢Δର৅ͷύοέʔδΛࢦఆ banimport_test.g o

  80. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 80 testdata ͷதͰظ଴஋(want)Λॻ͘ͷͰ͜͜ͷϩδοΫ͸εοΩϦʂ banimport_test.g o

  81. • ᶅ ࣮૷ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 81 ϝΠϯͱͳΔϩδοΫΛॻ͘

  82. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 82 banimport.go

  83. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 83 Analyzer ͷఆٛ import ͔͠ݟͳ͍ͷͰ ґଘ΋ͳ͠ banimport.go

  84. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 84 ϑϥάҾ਺ͷఆٛ flags ύοέʔδͱಉ౳ͷ ܗͰఆٛՄೳ banimport.go

  85. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 85 run ؔ਺ ϝΠϯͷॲཧΛߦ͏ؔ਺ → ࣍ͷεϥΠυ΁ banimport.go

  86. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 86 banimport.go

  87. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 87 ઃఆ jsonͷύʔε banimport.go

  88. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 88 ֤ϑΝΠϧͷ import ఆٛͷΈॲ ཧ͢Δ banimport.go

  89. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 89 import ͷύεΛऔಘ ※ จࣈྻϦςϥϧ͕ Value ʹೖ͍ͬͯΔͷͰ Unquote

    ͕ඞཁ banimport.go
  90. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 90 ېࢭ͢Δґଘ͕ݟ ͔ͭͬͨ৔߹ɺ ϝοηʔδΛग़͢ banimport.go

  91. • ᶆ ಈ࡞֬ೝ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 91

  92. • ᶆ ಈ࡞֬ೝ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 92

  93. • ᶆ ಈ࡞֬ೝ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 93

  94. • ᶆ ಈ࡞֬ೝ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 94

  95. • ᶆ ಈ࡞֬ೝ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 95

  96. • ᶆ ಈ࡞֬ೝ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 96

  97. • ᶆ ಈ࡞֬ೝ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 97

  98. • ᶆ ಈ࡞֬ೝ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 98 ग़ྗ݁Ռ

  99. • ᶆ ಈ࡞֬ೝ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 99 ग़ྗ݁Ռ

  100. • ᶆ ಈ࡞֬ೝ 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ 100 ग़ྗ݁Ռ testdata/src/a/srcb/ main.go

  101. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ ϞϊϨϙͰ΋ύοέʔδґଘͷ੍ޚ͕ Ͱ͖ΔΑ͏ʹͳͬͨʂʂ

  102. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ skeleton Λ࢖͑͹αΫοͱ࡞ΕΔʂ

  103. 5. ύοέʔδґଘ੍ޚπʔϧ࣮૷ ׬੒඼͸ͪ͜Β https://github.com/nrnrk/banimport

  104. ·ͱΊ 104 104

  105. • ·ͱΊ ◦ skeleton Λ࢖ͬͯαΫοͱ੩తղੳπʔϧ͕࡞ΕΔʂ ◦ ϞϊϨϙͳͲͰύοέʔδؒͷґଘΛ੍ޚ͍ͨ͠৔߹ ▪ ͞Βʹɺinternal ύοέʔδͷར༻΍Ϟδϡʔϧͷ෼ׂ͕ϑΟοτ͠ͳ͍৔߹

    ▪ → banimport Λ࢖ͬͯύοέʔδؒͷґଘ੍ޚΛࢼ͢Ձ஋͋Γʂ ▪ CI ͳͲʹ૊ΈࠐΉͱޡͬͨ import ͕๷͛Δ ◦ ͦͷଞ ▪ skeleton ͷ೔ຊޠ README ▪ Go ͷ AST ͷೖ໳తͳ಺༰ʹ͍ͭͯͷաڈͷൃද (એ఻) 105 6. ·ͱΊ