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

Goの静的解析を使用してAPI Doc Linterをつくる

muroon
January 28, 2020
44

Goの静的解析を使用してAPI Doc Linterをつくる

Goの静的解析機能を使用してAPI Doc用のLinterを作成した過程について説明します

muroon

January 28, 2020
Tweet

Transcript

  1. 0 . 0 . P 0fjgTg S 0 . =GGD

    ## D> " A# # D> <:G D G # AD@:#G: G 0 c_ D> : > " " D>1 A: AD@:4: G D>/ D AD@: D> A > G : 6 : a V D> A G > < A: <: D> : D G 0 = : * IIII A> " AD@: A> " AD@: # # de V c N A: GTih
  2. ) l a l v hje oy s G )

    c i oy t n ( j m a nA A S jdjc p ) G G / . . -. 1 2: . : .3
  3. P A C IB • • IB IB A V

    C V V D V A V I D V I
  4. ore bk g fd l CNMS N E R} AC

    AGE! • . }1NC dpsk uw • IM TSnic e EPTERSnqp h A IDASINM m sl } A I}VGESW} ADD CNTMS}a_sk{t } A I E RINM} } A I=RE}. I.TSH } A I A E} ERS.DD0NTMS } A I NT } ERS } A I A A }VTIMS)(W}SERS@ID} fk 1 } A I;TCCERR}V NSNW}. } NSN ERS.DD0NTMS FTMC} S}SERS0NMS N E !}.DD0NTMS !}HSS AMD E 3TMC}V EST M}FTMC U}HSS :ER NMRE ISE } } HSS :EPTERS!}V DASA}*,}MEU IM TS ERS M TS! IF}E }*,} EP A RE3N ! }E } ,}MI }V EST M} ER NMRE . 2 N U } }E ! W }/IMD BIMDDASA}*,}DASA 3IE D A !
  5. fk V b I Ic t " • beigI l

    T T • beigI d lc d aI h l po • ) : g _cr t s q m t * t tF *(t . : t &&t) : td lcMR pnMR g _c t t * "t) : t , "t ) : tF t ) : F *( t ) : F ) ttttt / t&&t t s , t . : t ) : F ) ttttt D : t&&t t s , t
  6. /b . / / / / . / // /

    . / / . // / . • • . • . . /. :A a / / . /.
  7. lz a ] 2 : lz 12 2 i ]

    e : c a ry a ] . 2 .,, 1 : lz • 2 : 12 2 i s nu • t c a o ] e : t • s i] ] e : MA [ 12 2 i { ] e : ] e : 1 2 , 2 : } p 12 2 i ] e : ry . 2 .,, 1 : } p 2 : s nu o i][
  8. ci _ M M F{ : " { { EF

    F"{* D { FF EF"{ : * {K D F D { : * K (&{ : * K *AD &{{{{{ F EF { D &{FD    E F I DSm kqSon xe slSpt N{* ( Sm yh MaMdT Spt N{ FAD) DSm zg V _bfeM Sur N{, I ) DSm * ( { FAD) D {, I ) DR .A Tc
  9. V AED A = : A D A E D.

    A D I A D A D * D D D *E ( D D ) A D , E ) A K A D / * D E D F D D D A D *E ( *E ( O D D ) A D ) A O D , E ) A , E ) A O K K A D I PR N VP S DDA : : : : : D : A A D   
  10. c m . . : m : ( . .

    :m m * : m m . :m m . ) m m ) ) lS g m( . . i ( . . FS ( . m) EN da i D e : = k e =S h AE STP g
  11. lu!AF ; =" ; = = =; I,N I( A

    E= 0 E= * A= / P I= IF MA ; N (* ! O =" P ; = . =F ( (* O = .F : =; !N" O =!" MA ; (* ! O =" P ; = O = AF =I( AF =I0 E= * IAF !" AF =Iwr A (* I E/ AF =I0 E= ) P I E/ AF =I0 E= * E =! IAF " E ot yj_SdSg kaw r T = =; I,N I px = =; I,N IX F; h bc e]Sic n ms [ 0 = a f
  12. p ! B :" F: F .:K : E A:

    = A: ( , : L E: EB , : lcehS u M FI = ( .:K ! K :" L F: F :B A: ( , EA L E: EB , EA NohS u M M FI = ( : ! K :" L F: F * F / E A B :E A: ( :B ! E A B :E A: :" V M na gimlNd}] w .:K : E]s .:K : ET {rx nfmo .:KT :]ty [) :d k
  13. qtiego k h p CNMS N E R AC AGE!

    A I GES ADD CNTMS fduo A I E RINM A I=RE . I.TSH A I A E ERS.DD0NTMS A I NT ERS A I A A TIMS)( SERS@ID n o 1 A I;TCCERR NSN . NSN ERS.DD0NTMS FTMC S SERS0NMS N E ! .DD0NTMS ! HSS AMD E 3TMC EST M FTMC U HSS :ER NMRE ISE HSS :EPTERS! DASA *, MEU IM TS ERS M TS! IF E *, EP A RE3N ! E , MI EST M ER NMRE . 2 N U E ! /IMDb { BIMDDASA *, DASA 3IE D A ! IMR ECS .MA W E bz _w b { skmp xb} 3TMC1EC bz 3IE D A b y _ arcul b} ;E ECSN 2V bz  
  14. dj">JIOMJGG MNp >F > N p NO G >OJM R

    M) pO G p *p . G pTpM O MIp N O>CpRp)*pO "OS pT > N p NO 0 IO) J IO M p*p NN S N0I J =E >O "R S " OM I " G Np)*p / O. G N" J IO M pG I" G N p p(pT MM. G Np)*p F " :NOM I %p(%pG I" G N JMp %p G p)*pM I p G NpT pNOM I N ,JIO IN">J ION RO%p G pT =M F MM. G Np*p I " MM. G N%p G pG I" MM. G N p p(pT NN JMO " JN%p O M IO " IJp>J IOpJIpM NOp M O M p OCJ )!N%p G N) !N: % OCJ %pNOM I N J I" MM. G N%p % % pppp p]b in o. G ge X[a c_l hk p G >OJM R M fm
  15. . // F : / # P / / /

    # / / / / . .
  16. / / • hfb l R • / ( /

    Omn T Ed Omn • I ep • i / o a hb j FOep • o / Ob j c G)/ / ep / / / / / A . / . . / /
  17. ) * , ) , * , ) () ).,

    ) ) ) * , ) , * , ) * () )., ) , () )., ) *
  18. F 1 F • FA E • 1 . 1

    12 F • 1 .2 . 1 . 1 12 F 1 . F E 1
  19. * RT NM A (= G A = G (=

    G A & : A ) & = .D=& AD= . D A & = G (= G A = (= G A * G & = G * = F , * " G , * A = A = D= , * " (* " D= , * " * = A A = " A = A DA= " = A
  20. ( E & (. ( ( • ( & )

    E F ) ( • & (. M P
  21. PINMf i . " i((i : = = i =i/

    i i (i= : i . = " i i " i (i : i : : C =i i , = i (i = . " i! &&i F _g i = i : = = • ) : = = M ec = . : M _g • = P M. _g PM . " = " Md a f
  22. . E I . I I I E F A

    . . . . . .
  23. / P / AI Q . / . / /

    , / , / / , . / : / / / ,
  24. daR o l 0A4 8 f i n 0A4 8

    i k m jc 146F fr T ( n i k 0A4 8 m jc 28 F3 8 fr T ) s hg T p0A4 8 p R jc ( hg T eb FF / F8AAF8AA 78 4 F 4A4 #86 F8 FF / A 8 4F8A4 : 6 8AF ( - ( . ) FF / 7 : , : F ( . ) ( : #6 84F8#F 8#6 86 # 4A7 A : #F 8 #F 8#: #F 8#6 86 8 FF / F8 8A : F : #9 #: #