Your SlideShare is downloading. ×
Happy Go programing
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Happy Go programing

829

Published on

- Go is a general-purpose language that bridges the gap between efficient statically typed languages and productive dynamic language. …

- Go is a general-purpose language that bridges the gap between efficient statically typed languages and productive dynamic language.

- Go is an open source programming language. Go makes it easy to build simple, reliable, and efficient software.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
829
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Happy Go Programing.! A Short Introduction
  • 2. Who am I Pravin Mishra Software Engineer @ShepHertz Working on App42 PaaS (Public Cloud Platform-as-a-Service) Keep in touch - @pravinmishra88
  • 3. What is Go? - Go is a general-purpose language that bridges the gap between efficient statically typed languages and productive dynamic language. - Go is an open source programming language. Go makes it easy to build simple, reliable, and efficient software.
  • 4. Go • Initially developed at Google • Created by Ken Thompson (Unix), Rob Pike (Plan 9), and Russ Cox (libtask) • Development started in 2007 • First release in 2009 (Fairly new!)
  • 5. Features ● Simple, minimal syntax ● Fast compilation times ● Easy concurrency support via goroutines ● Garbage-collected ● A flexible interface system ● Statically linked binaries ● Simple & Fun!
  • 6. Language focus • System programming • Networked / multi-core • Fast • Compatible with C • Best of static typed language and dynamic typed languages
  • 7. Hello World package main import "fmt" func main() { fmt.Println("Hello World") }
  • 8. Compiled language $ go build hello.go $ ls hello hello.go $ ./hello Hello Word
  • 9. Strong types func main() { var str string var value int str = "abc" value = 123 str + value } $ go run strong_type.go prog.go:8: invalid operation: str + value (mismatched types string and int) [process exited with non-zero status]
  • 10. Static Typed // types.go func main() { var a string a = 123 } $ go run types.go prog.go:5: cannot use 123 (type int) as type string in assignment [process exited with non-zero status]
  • 11. with dynamic casting package main import ( "fmt" ) func main() { a := 123 fmt.Printf("Value of a: %d", a) } - Value of a: 123
  • 12. User defined types package main; type Animal struct { Name string Age int } func main() { var anaconda Animal }
  • 13. Compiler • Uses GCC as back end • Checks for unused packages and variables • Checks types and return values
  • 14. Go tools • go fmt -> format your source code (cool!) • go get -> manage and install your dependencies • go build / run -> compile and run your program • go test -> run your tests
  • 15. Organizing code package string_processing; func Process(str string) { // Code code code } package main import "string_processing" func main() { string_processing.Process("foobar") }
  • 16. Who is using Go? • Google (dl.google.com, youtube) • SoundCloud • Heroku • CloudFlare • Ubuntu
  • 17. Wrapping up... • Cool language • Concurrent and networked • Benefits from both dynamic and static typed languages • Modern • Give it a try!
  • 18. Thank you.!

×