Slide 1

Slide 1 text

Copyright © 2017 eureka, Inc. All rights reserved. Go Package Guidelines $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Shintaro Kaneko

Slide 2

Slide 2 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy ۚࢠ৻ଠ࿠(kaneshin) w CTO at Eureka, Inc. w ࣄۀʷςΫϊϩδʔͷઓཱུҊɾ࣮ߦ w ΤϯδχΞ૊৫શମͷϚωδϝϯτ About me Τ΢ϨΧࣥߦ໾һCTOब೚ 2016/10 2012/10 2013/10 Τ΢ϨΧϚωʔδϟʔब೚ ૊ࠐܥاۀ΁ೖࣾ Τ΢ϨΧ΁ೖࣾ ΧφμͷόϯΫʔόʔ΁ཹֶ 2010/04 2011/12

Slide 3

Slide 3 text

3 Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package Guidelines

Slide 4

Slide 4 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy 2(Pͷύοέʔδߏ੒ʹ ೰Μͩ͜ͱ͕͋Δํ

Slide 5

Slide 5 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy "೰Ή

Slide 6

Slide 6 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy ׳ΕΔͱγϯϓϧͷԸܙ ͨͩ͠ɺݴޠԽ͕গ͠೉͍͠

Slide 7

Slide 7 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy গͣͭ͠஌ݟΛஷΊ͍ͯ͜͏

Slide 8

Slide 8 text

Package names 8 Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy

Slide 9

Slide 9 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package names 1 2 খจࣈͷΈͰɺεωʔΫέʔεɾΩϟϝϧέʔεΛ༻͍ͳ͍ 3 ෳ਺ܗʹ͠ͳ͍ 4 Don't steal good names from the user. ؆ܿͳ୯ޠ΍লུΛ͠ɺ໨త͕໌֬ͳ໊শʹ͢Δ

Slide 10

Slide 10 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package names ⭕ import "io" // I/O ⭕ import "net/http/httputil" // HTTP utility functions ⭕ import "strconv" // Abbreviation (string conversion) ❌ import "util" // Conventional name ❌ import "my_http_util" // Camel case ❌ import "myHttpUtil" // Snake case ❌ import "models" // Plural ❌ import "buf" // `buf` is a good variable name for a buffer.

Slide 11

Slide 11 text

Package structure 11 Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy

Slide 12

Slide 12 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package structure foo/ |_ bar/ | |_ qux/ | | |_ qux.go | |_ bar.go |_ foo.go

Slide 13

Slide 13 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package structure foo/ |_ bar/ | |_ qux/ | | |_ qux.go | |_ bar.go |_ foo.go

Slide 14

Slide 14 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package structure foo/ |_ bar/ // 抽象 | |_ qux/ // 具象 | | |_ qux.go | |_ bar.go |_ foo.go

Slide 15

Slide 15 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package structure foo/ |_ bar/ // 抽象 | |_ qux/ // 具象 | | |_ qux.go | |_ bar.go |_ foo.go io/... crypto/... encoding/...

Slide 16

Slide 16 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package names 1 2 ۩৅ϨΠϠͰ͸ந৅ϨΠϠͷinterfaceΛຬ͍ͨͯ͘͠ 3 ۩৅ϨΠϠ͸୯७ʹ্ҐϨΠϠͷutilͰ͋Δ͜ͱ΋͋Δ 4 ݁ߏଟ͘ɺࣦഊ͠ʹ͍͘ ந৅ϨΠϠͰ͸interfaceΛఆٛ͠ɺۃྗύοέʔδΛബ͘͢Δ

Slide 17

Slide 17 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package structure foo/ |_ bar/ | |_ qux/ | | |_ qux.go | |_ bar.go |_ foo.go

Slide 18

Slide 18 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package structure foo/ |_ bar/ // 具象 | |_ qux/ // 具象 | | |_ qux.go | |_ bar.go |_ foo.go

Slide 19

Slide 19 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package structure foo/ |_ bar/ // 具象 | |_ qux/ // 具象 | | |_ qux.go | |_ bar.go |_ foo.go net/...

Slide 20

Slide 20 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package names 1 2 ্Ґͷ۩৅ϨΠϠͰ͸γϯϓϧͳػೳ͔͠ఏڙ͠ͳ͍ 3 ୯७ʹ্ҐϨΠϠͷutil΋͋Δʢutilͱ͍͏໊લ͸ආ͚Δʣ 4 ύοέʔδͷࡉ෼Խͱ૚Λؾʹ͢Δ͜ͱʢ΍Γա͗͸μϝʣ ࠷্Ґʹந৅ϨΠϠ͕ఆٛ͞Ε͍ͯΔ͜ͱ͕ྑ͋͘Δ

Slide 21

Slide 21 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package structure foo/ |_ bar/ | |_ qux/ | | |_ qux.go | |_ bar.go |_ foo.go

Slide 22

Slide 22 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package structure foo/ |_ bar/ // 具象 | |_ qux/ // 抽象 | | |_ qux.go | |_ bar.go |_ foo.go

Slide 23

Slide 23 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package structure foo/ |_ bar/ // 具象 | |_ qux/ // 抽象 | | |_ qux.go | |_ bar.go |_ foo.go database/sql/...

Slide 24

Slide 24 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Package names 1 2 ۩৅ϨΠϠͰ͸ந৅ϨΠϠͷinterfaceΛຬ͍ͨͯ͘͠ 3 ۩৅ϨΠϠΛΧελϚΠζՄೳʹ͢Δ 4 ͜ͷઃܭ͸೉͍͠ ந৅ϨΠϠͰ͸interfaceΛఆٛ͢Δ

Slide 25

Slide 25 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Ͳ͏͍͏ߟ͑Ͱॻ͍͍ͯΔͷ͔ ݟͯ΋Βͬͨ΄͏͕ૣ͍

Slide 26

Slide 26 text

Others 26 Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy

Slide 27

Slide 27 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy Others 1 2 internal package 3 cmd package Sub Repositories: golang.org/x

Slide 28

Slide 28 text

Copyright © 2017 eureka, Inc. All rights reserved. $0/'*%&/5*"- Not for Public Distribution - Do Not Copy ͱʹ͔͘ɺ໺ྑͰͳ͘ ඪ४ύοέʔδΛࢀߟʹ

Slide 29

Slide 29 text

Making a great impact on people’s life.