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

GoでGemを作っています

B002134f2e824b2100761da10a9765a9?s=47 enta0701
October 24, 2017

 GoでGemを作っています

LT資料

B002134f2e824b2100761da10a9765a9?s=128

enta0701

October 24, 2017
Tweet

More Decks by enta0701

Other Decks in Technology

Transcript

  1. (PͰ(FNΛ࡞͍ͬͯ·͢ ʮ࠷ۙɺ(Pݴޠ࢝Ί·ͨ͠ʯͷձ !FOUB

  2. ࣗݾ঺հ ❐ɹԕ౻୓໵ ❐ɹגࣜձࣾϕʔγοΫʢ৽ଔ̍೥໨ʣ ❐ɹؠख㱺౦ژ ❐ɹ3VCZ%PDLFSLT ɹ(P"OESPJE+4 ❐ɹ(Pྺɿϲ݄͙Β͍ !FOUB !FOEPUBLVZB !FOUB

  3. ຊ୊

  4. (PͰ(FNΛ࡞͍ͬͯ·͢

  5. ࣾ಺ʹͯ 3BJMT͚ͩͰ ը૾ΛಈతϦαΠζ͍ͨ͠ ❐ύϥϝʔλʹαΠζΛ෇༩ͯ͠ಈతϦαΠζ ❐ࣄલϦαΠζ͸6*ͷมߋʹऑ͍

  6. ํ๏͸͍Ζ͍Ζ͋ΔΒ͍͠ ❐ɹOHJOYͷը૾ϦαΠζαʔό ❐ɹ"LBNBJ ❐ɹJNHJY ❐ɹ*NBHF3FTJ[FS ͱ͔ͱ͔ɻ

  7. ;ͱ ͋Δ2JJUBͷهࣄΛࢥ͍ग़ͨ͠

  8. 3VCZ͔Β(PΛ͍͡ΕΔ ❐໿ഒ଎͘ͳΔʁʂ ❐''*ʢ'PSFJHO'VODUJPO*OUFSGBDFʣ ❐ͳΜ͔ྑͦ͞͏ʢͦΜͳʹਂ͘ߟ͑ͣʣ

  9. ࡞ͬͯΈͨ ❐JSFT ɾը૾ॲཧʢ3FTJ[F $SPQ FUDʣ͸ɺ(P೚ͤ ɾ3VCZʢ(FNʣ͸ɺ(Pͷؔ਺Λݺͼग़͚ͩ͢ ɾ%PXOMPBET͙Β͍ ɾΩϟογϡରԠ <%= ires_tag(

    path: "image.jpg", width: 90, height: 120 ) %>
  10. ͓ੈ࿩ʹͳͬͨύοέʔδ ❐ϦαΠζ ɾHJUIVCDPNOGOUSFTJ[F ɾґଘύοέʔδͳ͠ ❐੾Γൈ͖ ɾHJUIVCDPNPMJBNCDVUUFS ɾґଘύοέʔδͳ͠

  11. ''*Ͱ(PΛ࢖͏४උ 3VCZ͔Β''*ͰಡΈࠐΉͨΊʹ4IBSFE0CKFDUԽ package main import ( "C" ) func main()

    {} //export test func test() *C.char { return C.CString("test!!!") } ᶃ$ΛಡΈࠐΉ ᶄؔ਺໊Λࢦఆ
  12. ''*Ͱ(PΛ࢖͏४උ Ϗϧυ $ go build -buildmode=c-shared -o test.so main.go 㱺

    test.h test.so ͋ͱ͸ɺUFTUTPΛ3VCZଆͰݺΜͰ͋͛Ε͹0,
  13. ଎౓తʹ͸ʁ 3.BHJDL *SFT ʢΩϟογϡͳ͠ʣ *SFT ʢΩϟογϡ͋Γʣ NT NT NT ɾYʢ,#ʣͷը૾ຕ

    ɾYʢʣʹϦαΠζ ɾ7JFXͰදࣔ͢Δ͚ͩ
  14. ͪΐͬͱؾʹͳͬͯ·͢ 2%PDLFSͰ؀ڥΛ࡞Δ࣌ɺ ɹΞϓϦέʔγϣϯͷύεͬͯͲ͏ઃఆͯ͠·͔͢ʁ $ echo $GOPATH /go WORKDIR /go/src/ires #

    or WORKDIR /go/src/github.com/endotakuya/ires ͷͱ͖ɺ
  15. ·ͱΊ ɾॏΊͳॲཧΛ(Pʹ͓೚ͤͯ͠ΈΔͷ͸ΞϦ͔΋ ɾ4IBSFE0CKFDUº''*ͳͷͰɺ͍ΖΜͳݴޠʹରԠՄ ɾ$ͱ(PͰͷ஋ͷ΍ΓͱΓʢ$$4USJOHͱ͔ʣ͸஫ҙ ɾ(P͸ॻָ͍͍ͯͯ͠ʂʢ·ͩπϥ͞Λ෼͔ͬͯͳ͍͚ͩ ɾؾʹͳΔํ͸ͪ͜Β͔Β ɾIUUQTSVCZHFNTPSHHFNTJSFT ɾIUUQTHJUIVCDPNFOEPUBLVZBJSFT

  16. ͋Γ͕ͱ͏͍͟͝·ͨ͠