SlideShare a Scribd company logo
1 of 29
Next Generation
Language Go
Ricoh IT Solutions Co., Ltd.
Yoichiro Shimizu
@budougumi0617
Do you Know Go?
NO!!
What is Go ?
• New Programing Language(2009-)
• Launched by Google
• “C for the 21st century.”
Go Product
The Origin of Go
• http://www.gopl.io/ch1.pdf
Radical Simplicity
• Garbage collection
• Package system
• Pointer
• Never use Class
• goroutine etc…
Hello World
package main
import "fmt"
func main() {
fmt.Printf("Hello, Worldn")
}
Heap? Stack?
func getlocal() {
i := returnLocal()
fmt.Printf("No error %dn", i)
}
func returnLocal() int {
var localvale int
localvalue = 10
return &localvalue
}
Strong Type
func noboxing() {
var x int
var y int16
x = 10
// y = x // cannot use x as type int16
y = int16(x)
fmt.Printf("y = %dn", y)
}
Modern Pointer
func pointer() {
x := big.Int{} // x big.Int
y := big.NewInt(0) // y *big.Int
x.SetUint64(123) // x := 123
y.SetUint64(321) // Do not use arrow(->)
}
Support Complex Value
func math() {
var x complex64
x = 10i + 20
fmt.Println(x) // (20+10i)
}
Multiple Return
func multireturn() {
q, r := division(10, 3)
fmt.Printf("%d, %dn", q, r)
}
func division(x, y int) (int, int) {
quotient := x / y
remainder := x % y
return quotient, remainder // 3, 1
}
Clousure
func closure() {
f := func(i int) {
fmt.Printf("Value is %dn", i)
}
f(20) // Value is 20
}
Concurrency Programing
func cuncurency() {
for i := 0; i < 10; i++ {
go func(num int) {
fmt.Printf("Thread No.%dn", num)
}(i) // Immediate execute
}
}
Interprocess Communication
func channel() {
// connection channel between each gorutine
c := make(chan int)
go func(c chan int) { // Create goroutine
var ans int
// Too large process.
c <- ans // send answer
}(c)
// Recieve answer
fmt.Printf("Result %dn", <-c)
}
Not use Class, Use Struct
func class() {
md := MyDirectory{name: "Document"}
fmt.Printf("Name is %sn", md.Name())
}
// MyDirectory defines Directory.
type MyDirectory struct {
name string
}
If it walks like a duck and quacks like
a duck, it must be a duck.
// Name returns name.
func (md *MyDirectory) Name() string {
return md.name
}
// MyComponent requests Name() method.
type MyComponent interface {
Name() string
}
func ducktyping() {
var mc MyComponent
mc = &MyDirectory{name: "Users"}
fmt.Printf("Name is %sn", mc.Name()) // Name is Users
}
Rich Standard Library
func websever() {
http.HandleFunc("/",
func(w http.ResponseWriter,
r *http.Request) {
fmt.Fprintf(w, "Hello World!n")
})
http.ListenAndServe(":8080", nil)
// http://localhost:8080/
}
Easy Cross Compile
$ GOOS=linux GOARCH=amd64 go build hello.go # For Linux
$ GOOS=darwin GOARCH=amd64 go build hello.go # For Mac
$ GOOS=windows GOARCH=amd64 go build hello.go # For windows
$ GOOS=android GOARCH=amd64 go build hello.go # For Android
Test framework
$ go test ./...
ok github.com/budougumi0617/GoTraining/ch11/ex01 0.019s
ok github.com/budougumi0617/GoTraining/ch11/ex02 0.023s
ok github.com/budougumi0617/GoTraining/ch11/ex03 0.023s
ok github.com/budougumi0617/GoTraining/ch11/ex04 0.027s
ok github.com/budougumi0617/GoTraining/ch11/ex05 0.017s
ok github.com/budougumi0617/GoTraining/ch11/ex06 0.016s
ok github.com/budougumi0617/GoTraining/ch11/ex07 0.014s
Get Code Coverage
$ go test -cover ./...
ok ch01/ex01 0.024s coverage: 100.0% of statements
ok ch01/ex02 0.022s coverage: 100.0% of statements
ok ch01/ex03 0.024s coverage: 100.0% of statements
ok ch01/ex04 0.024s coverage: 82.1% of statements
ok ch01/ex05 0.234s coverage: 100.0% of statements
ok ch01/ex06 0.601s coverage: 100.0% of statements
Execute Benchmark
$ go test -bench .
BenchmarkMyIntSetAdd100-4 200000 6307 ns/op
BenchmarkMapIntSetAdd1000-4 10000 235164 ns/op
BenchmarkMyIntSetAdd1000-4 20000 64169 ns/op
BenchmarkMapIntSetAddAll10-4 1000000 1253 ns/op
BenchmarkMyIntSetAddAll10-4 10000000 134 ns/op
BenchmarkMapIntSetAddAll100-4 100000 14568 ns/op
BenchmarkMapIntSetAddAll1000-4 10000 175950 ns/op
BenchmarkMyIntSetAddAll1000-4 200000 8360 ns/op
Do U want to try?
A Tour Of Go
• https://go-tour-jp.appspot.com/
Programing Langage Go
• http://amazon.jp/dp/4621300253
Thank U for Listening

More Related Content

What's hot

Golang slidesaudrey
Golang slidesaudreyGolang slidesaudrey
Golang slidesaudreyAudrey Lim
 
Exmaples of file handling
Exmaples of file handlingExmaples of file handling
Exmaples of file handlingsparkishpearl
 
AutoPagerize Shibuya.js 2007 9/15
AutoPagerize Shibuya.js 2007 9/15AutoPagerize Shibuya.js 2007 9/15
AutoPagerize Shibuya.js 2007 9/15swdyh
 
Kotlin For Android - Functions (part 3 of 7)
Kotlin For Android - Functions (part 3 of 7)Kotlin For Android - Functions (part 3 of 7)
Kotlin For Android - Functions (part 3 of 7)Gesh Markov
 
Introduction to Python3 Programming Language
Introduction to Python3 Programming LanguageIntroduction to Python3 Programming Language
Introduction to Python3 Programming LanguageTushar Mittal
 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simpleJohn Stevenson
 
Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in goYusuke Kita
 
Introduction to Clojure - EDGE Lviv
Introduction to Clojure - EDGE LvivIntroduction to Clojure - EDGE Lviv
Introduction to Clojure - EDGE Lvivzenyk
 
Gogo shell
Gogo shellGogo shell
Gogo shelljwausle
 
Laying Pipe with Transmogrifier
Laying Pipe with TransmogrifierLaying Pipe with Transmogrifier
Laying Pipe with TransmogrifierClayton Parker
 
LINE iOS開発で実践しているGit tips
LINE iOS開発で実践しているGit tipsLINE iOS開発で実践しているGit tips
LINE iOS開発で実践しているGit tipsLINE Corporation
 
Migrations With Transmogrifier
Migrations With TransmogrifierMigrations With Transmogrifier
Migrations With TransmogrifierRok Garbas
 
What is python
What is pythonWhat is python
What is pythonEU Edge
 

What's hot (19)

Golang slidesaudrey
Golang slidesaudreyGolang slidesaudrey
Golang slidesaudrey
 
Ast transformations
Ast transformationsAst transformations
Ast transformations
 
Exmaples of file handling
Exmaples of file handlingExmaples of file handling
Exmaples of file handling
 
Rakudo
RakudoRakudo
Rakudo
 
AutoPagerize Shibuya.js 2007 9/15
AutoPagerize Shibuya.js 2007 9/15AutoPagerize Shibuya.js 2007 9/15
AutoPagerize Shibuya.js 2007 9/15
 
Kotlin For Android - Functions (part 3 of 7)
Kotlin For Android - Functions (part 3 of 7)Kotlin For Android - Functions (part 3 of 7)
Kotlin For Android - Functions (part 3 of 7)
 
Introduction to Python3 Programming Language
Introduction to Python3 Programming LanguageIntroduction to Python3 Programming Language
Introduction to Python3 Programming Language
 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simple
 
Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in go
 
Introduction to Clojure - EDGE Lviv
Introduction to Clojure - EDGE LvivIntroduction to Clojure - EDGE Lviv
Introduction to Clojure - EDGE Lviv
 
Crystal Rocks
Crystal RocksCrystal Rocks
Crystal Rocks
 
JavaScriptとLisp
JavaScriptとLispJavaScriptとLisp
JavaScriptとLisp
 
Git avançado
Git avançadoGit avançado
Git avançado
 
Gogo shell
Gogo shellGogo shell
Gogo shell
 
Laying Pipe with Transmogrifier
Laying Pipe with TransmogrifierLaying Pipe with Transmogrifier
Laying Pipe with Transmogrifier
 
LINE iOS開発で実践しているGit tips
LINE iOS開発で実践しているGit tipsLINE iOS開発で実践しているGit tips
LINE iOS開発で実践しているGit tips
 
File. Java
File. JavaFile. Java
File. Java
 
Migrations With Transmogrifier
Migrations With TransmogrifierMigrations With Transmogrifier
Migrations With Transmogrifier
 
What is python
What is pythonWhat is python
What is python
 

Viewers also liked

Vault encryption support
Vault encryption supportVault encryption support
Vault encryption supportSumit Lonial
 
Introduction to Go language
Introduction to Go languageIntroduction to Go language
Introduction to Go languageTzar Umang
 
Private Apps in the Public Cloud - DevConTLV March 2016
Private Apps in the Public Cloud - DevConTLV March 2016Private Apps in the Public Cloud - DevConTLV March 2016
Private Apps in the Public Cloud - DevConTLV March 2016Issac Goldstand
 
Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsDerek Downey
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programmingMahmoud Masih Tehrani
 
Trying out the Go language with Google App Engine
Trying out the Go language with Google App EngineTrying out the Go language with Google App Engine
Trying out the Go language with Google App EngineLynn Langit
 
Vault - Secret and Key Management
Vault - Secret and Key ManagementVault - Secret and Key Management
Vault - Secret and Key ManagementAnthony Ikeda
 
Service Discovery. Spring Cloud Internals
Service Discovery. Spring Cloud InternalsService Discovery. Spring Cloud Internals
Service Discovery. Spring Cloud InternalsAleksandr Tarasov
 
Hashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsHashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsRamit Surana
 
Consul: Service-oriented at Scale
Consul: Service-oriented at ScaleConsul: Service-oriented at Scale
Consul: Service-oriented at ScaleC4Media
 
Go language presentation
Go language presentationGo language presentation
Go language presentationparamisoft
 
Go Language Hands-on Workshop Material
Go Language Hands-on Workshop MaterialGo Language Hands-on Workshop Material
Go Language Hands-on Workshop MaterialRomin Irani
 
Spring cloud for microservices architecture
Spring cloud for microservices architectureSpring cloud for microservices architecture
Spring cloud for microservices architectureIgor Khotin
 
Service discovery in a microservice architecture using consul
Service discovery in a microservice architecture using consulService discovery in a microservice architecture using consul
Service discovery in a microservice architecture using consulJos Dirksen
 
Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudEberhard Wolff
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesSreenivas Makam
 
Language to Go: Learning Language with Mobile Devices
Language to Go: Learning Language with Mobile DevicesLanguage to Go: Learning Language with Mobile Devices
Language to Go: Learning Language with Mobile DevicesShelly Sanchez Terrell
 

Viewers also liked (17)

Vault encryption support
Vault encryption supportVault encryption support
Vault encryption support
 
Introduction to Go language
Introduction to Go languageIntroduction to Go language
Introduction to Go language
 
Private Apps in the Public Cloud - DevConTLV March 2016
Private Apps in the Public Cloud - DevConTLV March 2016Private Apps in the Public Cloud - DevConTLV March 2016
Private Apps in the Public Cloud - DevConTLV March 2016
 
Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL Secrets
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programming
 
Trying out the Go language with Google App Engine
Trying out the Go language with Google App EngineTrying out the Go language with Google App Engine
Trying out the Go language with Google App Engine
 
Vault - Secret and Key Management
Vault - Secret and Key ManagementVault - Secret and Key Management
Vault - Secret and Key Management
 
Service Discovery. Spring Cloud Internals
Service Discovery. Spring Cloud InternalsService Discovery. Spring Cloud Internals
Service Discovery. Spring Cloud Internals
 
Hashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsHashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOps
 
Consul: Service-oriented at Scale
Consul: Service-oriented at ScaleConsul: Service-oriented at Scale
Consul: Service-oriented at Scale
 
Go language presentation
Go language presentationGo language presentation
Go language presentation
 
Go Language Hands-on Workshop Material
Go Language Hands-on Workshop MaterialGo Language Hands-on Workshop Material
Go Language Hands-on Workshop Material
 
Spring cloud for microservices architecture
Spring cloud for microservices architectureSpring cloud for microservices architecture
Spring cloud for microservices architecture
 
Service discovery in a microservice architecture using consul
Service discovery in a microservice architecture using consulService discovery in a microservice architecture using consul
Service discovery in a microservice architecture using consul
 
Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring Cloud
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and Kubernetes
 
Language to Go: Learning Language with Mobile Devices
Language to Go: Learning Language with Mobile DevicesLanguage to Go: Learning Language with Mobile Devices
Language to Go: Learning Language with Mobile Devices
 

Similar to Next Generation Language Go

Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of GoFrank Müller
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes
 
Introduction to go
Introduction to goIntroduction to go
Introduction to goJaehue Jang
 
golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptxGuy Komari
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoJaehue Jang
 
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티JaeYeoul Ahn
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my dayTor Ivry
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs偉格 高
 
To GO or not to GO
To GO or not to GOTo GO or not to GO
To GO or not to GOsuperstas88
 
Coding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBMCoding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBMRaveen Perera
 
Introduction to Scalding and Monoids
Introduction to Scalding and MonoidsIntroduction to Scalding and Monoids
Introduction to Scalding and MonoidsHugo Gävert
 
Tuga IT 2017 - What's new in C# 7
Tuga IT 2017 - What's new in C# 7Tuga IT 2017 - What's new in C# 7
Tuga IT 2017 - What's new in C# 7Paulo Morgado
 
Extreme Swift
Extreme SwiftExtreme Swift
Extreme SwiftMovel
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokusHamletDRC
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)Ishin Vin
 

Similar to Next Generation Language Go (20)

Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of Go
 
ProgrammingwithGOLang
ProgrammingwithGOLangProgrammingwithGOLang
ProgrammingwithGOLang
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage Go
 
Introduction to go
Introduction to goIntroduction to go
Introduction to go
 
golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptx
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my day
 
Go Workshop Day 1
Go Workshop Day 1Go Workshop Day 1
Go Workshop Day 1
 
Golang勉強会
Golang勉強会Golang勉強会
Golang勉強会
 
Let's Go-lang
Let's Go-langLet's Go-lang
Let's Go-lang
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
 
To GO or not to GO
To GO or not to GOTo GO or not to GO
To GO or not to GO
 
Object-oriented Basics
Object-oriented BasicsObject-oriented Basics
Object-oriented Basics
 
Coding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBMCoding in GO - GDG SL - NSBM
Coding in GO - GDG SL - NSBM
 
Introduction to Scalding and Monoids
Introduction to Scalding and MonoidsIntroduction to Scalding and Monoids
Introduction to Scalding and Monoids
 
Tuga IT 2017 - What's new in C# 7
Tuga IT 2017 - What's new in C# 7Tuga IT 2017 - What's new in C# 7
Tuga IT 2017 - What's new in C# 7
 
Extreme Swift
Extreme SwiftExtreme Swift
Extreme Swift
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokus
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)
 

Recently uploaded

(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 

Recently uploaded (20)

(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 

Next Generation Language Go

  • 1. Next Generation Language Go Ricoh IT Solutions Co., Ltd. Yoichiro Shimizu @budougumi0617
  • 3.
  • 5.
  • 6. What is Go ? • New Programing Language(2009-) • Launched by Google • “C for the 21st century.”
  • 8. The Origin of Go • http://www.gopl.io/ch1.pdf
  • 9. Radical Simplicity • Garbage collection • Package system • Pointer • Never use Class • goroutine etc…
  • 10. Hello World package main import "fmt" func main() { fmt.Printf("Hello, Worldn") }
  • 11. Heap? Stack? func getlocal() { i := returnLocal() fmt.Printf("No error %dn", i) } func returnLocal() int { var localvale int localvalue = 10 return &localvalue }
  • 12. Strong Type func noboxing() { var x int var y int16 x = 10 // y = x // cannot use x as type int16 y = int16(x) fmt.Printf("y = %dn", y) }
  • 13. Modern Pointer func pointer() { x := big.Int{} // x big.Int y := big.NewInt(0) // y *big.Int x.SetUint64(123) // x := 123 y.SetUint64(321) // Do not use arrow(->) }
  • 14. Support Complex Value func math() { var x complex64 x = 10i + 20 fmt.Println(x) // (20+10i) }
  • 15. Multiple Return func multireturn() { q, r := division(10, 3) fmt.Printf("%d, %dn", q, r) } func division(x, y int) (int, int) { quotient := x / y remainder := x % y return quotient, remainder // 3, 1 }
  • 16. Clousure func closure() { f := func(i int) { fmt.Printf("Value is %dn", i) } f(20) // Value is 20 }
  • 17. Concurrency Programing func cuncurency() { for i := 0; i < 10; i++ { go func(num int) { fmt.Printf("Thread No.%dn", num) }(i) // Immediate execute } }
  • 18. Interprocess Communication func channel() { // connection channel between each gorutine c := make(chan int) go func(c chan int) { // Create goroutine var ans int // Too large process. c <- ans // send answer }(c) // Recieve answer fmt.Printf("Result %dn", <-c) }
  • 19. Not use Class, Use Struct func class() { md := MyDirectory{name: "Document"} fmt.Printf("Name is %sn", md.Name()) } // MyDirectory defines Directory. type MyDirectory struct { name string }
  • 20. If it walks like a duck and quacks like a duck, it must be a duck. // Name returns name. func (md *MyDirectory) Name() string { return md.name } // MyComponent requests Name() method. type MyComponent interface { Name() string } func ducktyping() { var mc MyComponent mc = &MyDirectory{name: "Users"} fmt.Printf("Name is %sn", mc.Name()) // Name is Users }
  • 21. Rich Standard Library func websever() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World!n") }) http.ListenAndServe(":8080", nil) // http://localhost:8080/ }
  • 22. Easy Cross Compile $ GOOS=linux GOARCH=amd64 go build hello.go # For Linux $ GOOS=darwin GOARCH=amd64 go build hello.go # For Mac $ GOOS=windows GOARCH=amd64 go build hello.go # For windows $ GOOS=android GOARCH=amd64 go build hello.go # For Android
  • 23. Test framework $ go test ./... ok github.com/budougumi0617/GoTraining/ch11/ex01 0.019s ok github.com/budougumi0617/GoTraining/ch11/ex02 0.023s ok github.com/budougumi0617/GoTraining/ch11/ex03 0.023s ok github.com/budougumi0617/GoTraining/ch11/ex04 0.027s ok github.com/budougumi0617/GoTraining/ch11/ex05 0.017s ok github.com/budougumi0617/GoTraining/ch11/ex06 0.016s ok github.com/budougumi0617/GoTraining/ch11/ex07 0.014s
  • 24. Get Code Coverage $ go test -cover ./... ok ch01/ex01 0.024s coverage: 100.0% of statements ok ch01/ex02 0.022s coverage: 100.0% of statements ok ch01/ex03 0.024s coverage: 100.0% of statements ok ch01/ex04 0.024s coverage: 82.1% of statements ok ch01/ex05 0.234s coverage: 100.0% of statements ok ch01/ex06 0.601s coverage: 100.0% of statements
  • 25. Execute Benchmark $ go test -bench . BenchmarkMyIntSetAdd100-4 200000 6307 ns/op BenchmarkMapIntSetAdd1000-4 10000 235164 ns/op BenchmarkMyIntSetAdd1000-4 20000 64169 ns/op BenchmarkMapIntSetAddAll10-4 1000000 1253 ns/op BenchmarkMyIntSetAddAll10-4 10000000 134 ns/op BenchmarkMapIntSetAddAll100-4 100000 14568 ns/op BenchmarkMapIntSetAddAll1000-4 10000 175950 ns/op BenchmarkMyIntSetAddAll1000-4 200000 8360 ns/op
  • 26. Do U want to try?
  • 27. A Tour Of Go • https://go-tour-jp.appspot.com/
  • 28. Programing Langage Go • http://amazon.jp/dp/4621300253
  • 29. Thank U for Listening