Professional Documents
Culture Documents
Go Lang
Go Lang
ON
GOLANG-By GOOGLE
Guided By :
Dr. Rajesh
Mishra
Submitted By:
Praval kulshreshtha
(12/iec/064)
Prem shankar
(12/iec/038)
Srishty verma
(12/iec/010)
Himanshu choudhary
(12/iec/041
)
BUDDHA
UNIVERSITY
>> INTRODUCTION
- Go1.1.2
- Go1.2.1
- Go1.2.2
- Go1.3.1
- Go1.3.2
- Go1.3.3
- Go1.4.1
- Go1.4.2
- Go1.4.3
- Go1.5.1
>> ANSWERS
Started as an answer to software problems at Google:
multicore processors
networked systems
massive computation clusters
scale: 10 lines of code
scale: 10 programmers
scale: 10 machines (design point)
Deployed: parts of YouTube, dl.google.com, Blogger, Google
Code, Google Fiber
>> CONCURRENCY
Go provides two important concepts:
A goroutine
A channel
Concurrency: CSP
Channels adopted from Hoare's Communicating Sequential
Processes.
Orthogonal to rest of language
Can keep familiar model for computation
Focus oncompositionof regular code
>> CONCURRENCY
package main
import "fmt
func main() {
c := make(chan
string) go func()
{
c <- "Hello"
c <- "World"
}()
fmt.Println(<-c,
<-c)
code }
run
>> POLYMORPHISM
Interfaces
An interface defines a set of methods. Implementation of an
interface can be assigned to a variable of that interface type.
Interface Advantages
no dependence between interface and implementation
easy testing
avoids overdesign, rigid hierarchy of inheritance-based OO
The source of all generality in the Go language
>> POLYMORPHISM
b := new(bytes.Buffer)
var w io.Writer
w = b
fmt.Fprintf(w, "hello,
%s\n", "world")
os.Stdout.Write(b.Bytes(
))
code
run
Advantages:
Disadvantages:
The packages distributed with Go are pretty useful, but there are
still some libraries you'll miss. Most notably a UI toolkit.
There is no support for generics in Go, although there are many
discussions around it.
>> GO USERS
Other companies and sites using Go (generally together with other languages, not
exclusively) include:
Google
Dropbox
CloudFlare
Railgun
SoundCloud
TheBBC
Novartis
Splice
Cloud Foundry
CoreOS
MongoDB
Zerodha
Chango
SendGrid
Plug.dj
THANK YOU..!!!