Slide 1

Slide 1 text

ήʔϜ։ൃʹ͸͔ܽͤͳ͍?! 
 ͋ΕΛγϡοͱݟΔ @Konboi/golang.tokyo #6

Slide 2

Slide 2 text

ࣗݾ঺հ • Ryosuke Yabuki a.k.a @Konboi • ໘ന๏ਓΧϠοΫ • εϚϗήʔϜͷ։ൃ/ӡ༻ ٕज़ج൫ • Go/Perl

Slide 3

Slide 3 text

ήʔϜ։ൃʹ͸͔ܽͤͳ͍?! 
 ͋ΕΛγϡοͱݟΔ

Slide 4

Slide 4 text

͋Ε ͱ͸?

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

CSV ͱ͸ • Comma Separated Value ͷུ • ΧϯϚ۠੾Γͷσʔλߏ଄

Slide 7

Slide 7 text

εϚϗήʔϜ։ൃʹ͸͔ܽͤͳ͍?! • Ϛελʔσʔλͷྫ

Slide 8

Slide 8 text

ΧϠοΫͷ৔߹

Slide 9

Slide 9 text

ΧϠοΫͷ৔߹ • ϚελσʔλΛGoogle SpreadSheetͰ؅ཧ • ൓ө͢Δ৔߹͸ • Google SpreadSheetͷσʔλΛ
 CSVܗࣜͰμ΢ϯϩʔυ • CSV͔ΒDBʹσʔλΛimport

Slide 10

Slide 10 text

ΧϠοΫͷ৔߹ • ϚελσʔλҎ֎ʹ΋ • ௐࠪܥσʔλ΋CSVܗࣜͰσΟϨΫλʔʹ • ήʔϜ֎ͷΩϟϯϖʔϯͳͲͷ
 ใु෇༩ͷσʔλ΋CSVͰ΍ΓͱΓ͢Δ͜ͱ΋

Slide 11

Slide 11 text

ΧϠοΫҎ֎ͷ৔߹Ͱ΋ • ʮϚελσʔλ Excelʯ • ʮϚελσʔλ SpreadSheetʯ • Ͱݕࡧ͢Δͱ৭ʑͱࣅͨΑ͏ͳࣄྫ͕ • ΧϠοΫͷࣄྫ͕ಛघͱ͍͏Θ͚Ͱ΋ͳͦ͞͏

Slide 12

Slide 12 text

CSV࠷ߴ

Slide 13

Slide 13 text

CSV࠷ߴ…?

Slide 14

Slide 14 text

CSVͰࠔΔ࣌ • औΓࠐΜͩσʔλ͕͓͔͘͠ͳ͍ʁ • ͪΐͬͱݟͯΑ • id:6ͷmax levelͳΜ͚ͩͲ • γʔτ্Ͱ͸Αͦ͞͏ͳΜ͚ͩͲ

Slide 15

Slide 15 text

CSVͰࠔΔ࣌

Slide 16

Slide 16 text

CSVͰࠔΔ࣌ • ͲΕͲΕɺͱΓ͋͑ͣσʔλݟͯΈΔ͔ • less weapon.csv

Slide 17

Slide 17 text

CSVͰࠔΔ࣌ • ΧϥϜͱσʔλͷؔ܎ੑ͕ݟͮΒ͍ • ۭཝͱ͔͕͋Δͱ • σʔλྔ͕ଟ͍ͱ • DBʹΠϯϙʔτ͢Δܥͷσʔλ͸DBͰΫΤϦΛ
 ୟ͚͹ΈΕΔ • ௐࠪܥͷσʔλ͸ͦ͏͍͏Θ͚ʹ͸͍͔ͳ͍ …

Slide 18

Slide 18 text

Konboi/csviewer

Slide 19

Slide 19 text

What is csviewer? • CSVΛ͍͍ײ͡ʹදࣔ͢Δ
 ίϚϯυϥΠϯπʔϧ • ݅਺ΛߜΔ • දࣔΧϥϜΛߜΔ • ؆୯ͳ৚͕݅ࣜ࢖༻Մೳ • go get github.com/Konboi/csviewer • ࣅͨΑ͏ͳtoolͰcsvkitͱ͍͏python੡ͷπʔϧ͕͋Γ·͢

Slide 20

Slide 20 text

What is csviewer?

Slide 21

Slide 21 text

What is csviewer? • ݅਺දࣔ
 limit, l Φϓγϣϯ

Slide 22

Slide 22 text

What is csviewer? • ؆୯ͳߜࠐ
 filter, f Φϓγϣϯ

Slide 23

Slide 23 text

What is csviewer? • දࣔΧϥϜͷߜࠐ 
 columns, c Φϓγϣϯ

Slide 24

Slide 24 text

What is csviewer? • ෳ਺૊Έ߹Θͤ΋Մೳ

Slide 25

Slide 25 text

࣮૷ʹ͋ͨͬͯ

Slide 26

Slide 26 text

࣮૷ʹ͋ͨͬͯ • soh335/sliceflag ++ • olekukonko/tablewriter ++

Slide 27

Slide 27 text

soh335/sliceflag

Slide 28

Slide 28 text

soh335/sliceflag • ಉҰΦϓγϣϯͰෳ਺ͷ஋Λड͚औΓ͍ͨͱ͖͕͋Δ • ࣗલͰ࣮૷͢Δͷ͸஍ຯʹ໘౗ • flag.ValueͷinterfaceΛຬͨ͢structͷ༻ҙ • ༻ҙͨ͠structͱflag.Var() Λ࢖༻ͯ͠ෳ਺ड͚औΔ • ৄ͘͠͸ 
 Goͷflag package Ͱಉ͡Φϓγϣϯ໊Ͱෳ਺ͷ஋Λड͚औΔ • ͱ͸͍͑ɺcodegangsta/cli, alecthomas/kingpin 
 Λ࢖͏·Ͱ΋ͳ͍͔ͳ...

Slide 29

Slide 29 text

soh335/sliceflag • ෳ਺ͷ஋Λ؆୯ʹड͚औΔ͜ͱ͕Ͱ͖Δ • flagͷීஈͷ࢖͍ํͱେ͖͘มΘΒͳ͍

Slide 30

Slide 30 text

olekukonko/tablewriter

Slide 31

Slide 31 text

olekukonko/tablewriter • ͍͍ײ͡ʹσʔλΛදࣔ͢Δͷ͸େม • ؆୯ && ៉ྷʹςʔϒϧܗࣜͰදࣔͯ͘͠ΕΔ

Slide 32

Slide 32 text

olekukonko/tablewriter

Slide 33

Slide 33 text

olekukonko/tablewriter

Slide 34

Slide 34 text

olekukonko/tablewriter

Slide 35

Slide 35 text

olekukonko/tablewriter • ଟগෳࡶͳϨΠΞ΢τ΋Մೳ

Slide 36

Slide 36 text

olekukonko/tablewriter • csvΛදࣔ͢Δ͚ͩͳΒ͜Ε͚ͩͰOK

Slide 37

Slide 37 text

ࠓޙͷ՝୊ • sortػೳ͕ཉ͍͠ • 1ΧϥϜෳ਺ϑΟϧλʔద༻Ͱ͖ΔΑ͏ʹ

Slide 38

Slide 38 text

·ͱΊ

Slide 39

Slide 39 text

·ͱΊ • CSVϏϡʔΞ csviewer Λ࡞ͬͨ࿩ • csviewer಺Ͱ࢖͍ͬͯΔศརpackageͷ঺հ • soh335/sliceflag • olekukonko/tablewriter • ੋඇ࢖ͬͯΈͯԼ͍͞ • PR Welcome

Slide 40

Slide 40 text

͝੩ௌ
 ͋Γ͕ͱ͏͍͟͝·ͨ͠