SlideShare a Scribd company logo
1 of 72
Learning Go From Hello
World to Web Service
Eric Potter
Sweetwater
Learning Go From Hello
World to Web Service
Eric Potter
Sweetwater
G
e
t
G
o
i
n
g
3
Learning Go From Hello
World to Web Service
Eric Potter
Sweetwater
Agenda
G
e
t
G
o
i
n
g
6
1:00 Intro, Background, Tooling, Basic Syntax
1:30 Exercises
2:00 Arrays / Slices, Types / Interfaces
2:30 Exercises
3:00 Go Routines
3:30 Exercises
4:00 Web Services
4:30 Exercises
Background
Before we go
7
Creators
Rob Pike
• Worked at Bell
Labs and Google
• co-creator of
UTF-8
Ken Thompson
• Designed and
implemented the
original Unix
Robert Griesemer
• Worked on
Google's V8
JavaScript engine
G
e
t
G
o
i
n
g
8
Fast
G
e
t
G
o
i
n
g
9
G
e
t
G
o
i
n
g
10
Tools
All systems go
11
Installation
P
R
E
S
E
N
T
A
T
I
O
N
T
I
T
L
E
12
Go CLI
• go run
• go build
• go mod init
• go test
• go get
• go fmt
• etc
G
e
t
G
o
i
n
g
13
IDEs
VS Code GoLand ($)
G
e
t
G
o
i
n
g
14
Hello World
Demo
G
e
t
G
o
i
n
g
15
Hello World
G
e
t
G
o
i
n
g
16
Imports
Single Multiple
G
e
t
G
o
i
n
g
17
Types
Go your own way
18
Basic Types
• bool
• string
• int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64
• rune // alias for int32 that represents a Unicode code point
• float32, float64
• complex64, complex128
G
e
t
G
o
i
n
g
19
Variable Declaration
G
e
t
G
o
i
n
g
20
Syntax
Let it go
21
Terse
; ( )
G
e
t
G
o
i
n
g
22
Notable Omissions
++i
do {}
while
G
e
t
G
o
i
n
g
23
Function Syntax
C#
public <returnType> <name> (<args>)
Go
func <name> (<args>) <returnType>
G
e
t
G
o
i
n
g
24
Fizz Buzz
Demo
G
e
t
G
o
i
n
g
25
Fizz Buzz
G
e
t
G
o
i
n
g
26
Questions
G
e
t
G
o
i
n
g
27
Exercise 1
Euler 1
1) If we list all the natural numbers below 10 that are multiples of 3
or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
2) The Sine value for 2 is positive and the value for 5 is negative.
Print the sum of the positive sine values from the input between 0
and 10. (hint import “math” and use math.Sin)
If you get done, try Euler 2 (https://projecteuler.net/problem=2)
G
e
t
G
o
i
n
g
28
Euler 1
G
e
t
G
o
i
n
g
29
G
e
t
G
o
i
n
g
30
Arrays
Go home
32
Declaring Arrays
G
e
t
G
o
i
n
g
33
Accessing Array Elements
G
e
t
G
o
i
n
g
34
G
e
t
G
o
i
n
g
35
Iterate over an Array
G
e
t
G
o
i
n
g
36
The size is part of the type
G
e
t
G
o
i
n
g
37
Slices
Go home
38
G
e
t
G
o
i
n
g
39
Dynamic Sizing
G
e
t
G
o
i
n
g
40
Ranges
G
e
t
G
o
i
n
g
41
Classes
Go home
42
Classes
Go home
43
Packages & Structs
Defining a Struct
G
e
t
G
o
i
n
g
44
G
e
t
G
o
i
n
g
45
G
e
t
G
o
i
n
g
46
Associating Functions with Structs
G
e
t
G
o
i
n
g
47
Interfaces
Go home
48
Defining an Interface
G
e
t
G
o
i
n
g
49
Checkerboard demo
Demo
G
e
t
G
o
i
n
g
50
Questions
G
e
t
G
o
i
n
g
51
Exercise 2
Create a GIF
Clone this repo: https://github.com/pottereric/GoGifBuilder
Using the image/gif and image/color packages, create a gif of a
checker board.
Using the same libraries, create an animated gif of a sine wave.
G
e
t
G
o
i
n
g
52
Concurrency
You go your way,
I’ll go mine
53
Concurrent Functions
Demo
G
e
t
G
o
i
n
g
54
G
e
t
G
o
i
n
g
55
Channels
Go change the
channel
56
TextEntryWithTimeout
Demo
G
e
t
G
o
i
n
g
57
TextEntryWithTimeout
G
e
t
G
o
i
n
g
58
WaitGroups
Go wait in the corner
59
G
e
t
G
o
i
n
g
60
Questions
G
e
t
G
o
i
n
g
61
Exercise 3
Create a GIF Concurrently
Modify your code that creates a sine wave gif to create the file
concurrently while the user enters the output file name.
G
e
t
G
o
i
n
g
62
G
e
t
G
o
i
n
g
63
G
e
t
G
o
i
n
g
64
Web Services
Go on
65
net/http Package
• The core functionality is in a standard library.
• There are packages like gin that provide structure.
G
e
t
G
o
i
n
g
66
net/http
G
e
t
G
o
i
n
g
67
net/http
G
e
t
G
o
i
n
g
68
Data Access
Go get it
69
database/sql
• Go uses a driver and plugin model.
• There are larger frameworks like Gorm
G
e
t
G
o
i
n
g
70
database/sql
G
e
t
G
o
i
n
g
71
Questions
G
e
t
G
o
i
n
g
72
Exercise 4
Web Services
Create a webservice that returns the sine of a given number.
Create a webservice that returns your sine wave GIF
G
e
t
G
o
i
n
g
73
Thank you
Eric Potter • @pottereric •
HumbleToolsmith.com
G
e
t
G
o
i
n
g
75

More Related Content

Similar to Learning Go From Hello World to Web Service.pptx

Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014Austin Ogilvie
 
How I become Go GDE
How I become Go GDEHow I become Go GDE
How I become Go GDEEvan Lin
 
Yuandong Tian at AI Frontiers : Planning in Reinforcement Learning
Yuandong Tian at AI Frontiers : Planning in Reinforcement LearningYuandong Tian at AI Frontiers : Planning in Reinforcement Learning
Yuandong Tian at AI Frontiers : Planning in Reinforcement LearningAI Frontiers
 
Feelin' Groovy: A Groovy Developer in the Java World
Feelin' Groovy: A Groovy Developer in the Java WorldFeelin' Groovy: A Groovy Developer in the Java World
Feelin' Groovy: A Groovy Developer in the Java WorldKen Kousen
 
Incompleteness for Startups
Incompleteness for StartupsIncompleteness for Startups
Incompleteness for Startupsblackbox
 
Coding Dojo: String Calculator (2013)
Coding Dojo: String Calculator (2013)Coding Dojo: String Calculator (2013)
Coding Dojo: String Calculator (2013)Peter Kofler
 
Day 1 - Python Overview and Basic Programming - Python Programming Camp - One...
Day 1 - Python Overview and Basic Programming - Python Programming Camp - One...Day 1 - Python Overview and Basic Programming - Python Programming Camp - One...
Day 1 - Python Overview and Basic Programming - Python Programming Camp - One...One Year Programming
 
쉽게 설명하는 GAN (What is this? Gum? It's GAN.)
쉽게 설명하는 GAN (What is this? Gum? It's GAN.)쉽게 설명하는 GAN (What is this? Gum? It's GAN.)
쉽게 설명하는 GAN (What is this? Gum? It's GAN.)Hansol Kang
 
JAZOON'13 - Stefan Saasen - True Git: The Great Migration
JAZOON'13 - Stefan Saasen - True Git: The Great MigrationJAZOON'13 - Stefan Saasen - True Git: The Great Migration
JAZOON'13 - Stefan Saasen - True Git: The Great Migrationjazoon13
 
Test Driven Development en Go con Ginkgo y Gomega
Test Driven Development en Go con Ginkgo y GomegaTest Driven Development en Go con Ginkgo y Gomega
Test Driven Development en Go con Ginkgo y GomegaSoftware Guru
 
Go programming introduction
Go programming introductionGo programming introduction
Go programming introductionGinto Joseph
 
Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)Peter Kofler
 
The Ring programming language version 1.7 book - Part 193 of 196
The Ring programming language version 1.7 book - Part 193 of 196The Ring programming language version 1.7 book - Part 193 of 196
The Ring programming language version 1.7 book - Part 193 of 196Mahmoud Samir Fayed
 
Grails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon ValleyGrails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon ValleySven Haiges
 
CS-102 DS-class_01_02 Lectures Data .pdf
CS-102 DS-class_01_02 Lectures Data .pdfCS-102 DS-class_01_02 Lectures Data .pdf
CS-102 DS-class_01_02 Lectures Data .pdfssuser034ce1
 

Similar to Learning Go From Hello World to Web Service.pptx (20)

True Git
True Git True Git
True Git
 
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
 
Go. why it goes v2
Go. why it goes v2Go. why it goes v2
Go. why it goes v2
 
How I become Go GDE
How I become Go GDEHow I become Go GDE
How I become Go GDE
 
Yuandong Tian at AI Frontiers : Planning in Reinforcement Learning
Yuandong Tian at AI Frontiers : Planning in Reinforcement LearningYuandong Tian at AI Frontiers : Planning in Reinforcement Learning
Yuandong Tian at AI Frontiers : Planning in Reinforcement Learning
 
Feelin' Groovy: A Groovy Developer in the Java World
Feelin' Groovy: A Groovy Developer in the Java WorldFeelin' Groovy: A Groovy Developer in the Java World
Feelin' Groovy: A Groovy Developer in the Java World
 
Incompleteness for Startups
Incompleteness for StartupsIncompleteness for Startups
Incompleteness for Startups
 
Coding Dojo: String Calculator (2013)
Coding Dojo: String Calculator (2013)Coding Dojo: String Calculator (2013)
Coding Dojo: String Calculator (2013)
 
Day 1 - Python Overview and Basic Programming - Python Programming Camp - One...
Day 1 - Python Overview and Basic Programming - Python Programming Camp - One...Day 1 - Python Overview and Basic Programming - Python Programming Camp - One...
Day 1 - Python Overview and Basic Programming - Python Programming Camp - One...
 
쉽게 설명하는 GAN (What is this? Gum? It's GAN.)
쉽게 설명하는 GAN (What is this? Gum? It's GAN.)쉽게 설명하는 GAN (What is this? Gum? It's GAN.)
쉽게 설명하는 GAN (What is this? Gum? It's GAN.)
 
JAZOON'13 - Stefan Saasen - True Git: The Great Migration
JAZOON'13 - Stefan Saasen - True Git: The Great MigrationJAZOON'13 - Stefan Saasen - True Git: The Great Migration
JAZOON'13 - Stefan Saasen - True Git: The Great Migration
 
Test Driven Development en Go con Ginkgo y Gomega
Test Driven Development en Go con Ginkgo y GomegaTest Driven Development en Go con Ginkgo y Gomega
Test Driven Development en Go con Ginkgo y Gomega
 
Go programming introduction
Go programming introductionGo programming introduction
Go programming introduction
 
Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)Idiomatic R for Rosetta Code (2013)
Idiomatic R for Rosetta Code (2013)
 
The Ring programming language version 1.7 book - Part 193 of 196
The Ring programming language version 1.7 book - Part 193 of 196The Ring programming language version 1.7 book - Part 193 of 196
The Ring programming language version 1.7 book - Part 193 of 196
 
Grails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon ValleyGrails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon Valley
 
CS-102 DS-class_01_02 Lectures Data .pdf
CS-102 DS-class_01_02 Lectures Data .pdfCS-102 DS-class_01_02 Lectures Data .pdf
CS-102 DS-class_01_02 Lectures Data .pdf
 
Ggplot2 1outof3
Ggplot2 1outof3Ggplot2 1outof3
Ggplot2 1outof3
 
Ggplot2 1outof3
Ggplot2 1outof3Ggplot2 1outof3
Ggplot2 1outof3
 
Intro. to Git and Github
Intro. to Git and GithubIntro. to Git and Github
Intro. to Git and Github
 

More from Eric Potter

KnowYouLimitations.pptx
KnowYouLimitations.pptxKnowYouLimitations.pptx
KnowYouLimitations.pptxEric Potter
 
KnowYouLimitations.pptx
KnowYouLimitations.pptxKnowYouLimitations.pptx
KnowYouLimitations.pptxEric Potter
 
Easy Automated UI Testing with Canopy
Easy Automated UI Testing with CanopyEasy Automated UI Testing with Canopy
Easy Automated UI Testing with CanopyEric Potter
 
Finding Your Place in the Cosmos - Azure Cosmos DB
Finding Your Place in the Cosmos - Azure Cosmos DBFinding Your Place in the Cosmos - Azure Cosmos DB
Finding Your Place in the Cosmos - Azure Cosmos DBEric Potter
 
TypeScript: Beyond The Basics
TypeScript: Beyond The BasicsTypeScript: Beyond The Basics
TypeScript: Beyond The BasicsEric Potter
 
C# pattern matching
C# pattern matchingC# pattern matching
C# pattern matchingEric Potter
 
Generalist or Specialist
Generalist or SpecialistGeneralist or Specialist
Generalist or SpecialistEric Potter
 

More from Eric Potter (7)

KnowYouLimitations.pptx
KnowYouLimitations.pptxKnowYouLimitations.pptx
KnowYouLimitations.pptx
 
KnowYouLimitations.pptx
KnowYouLimitations.pptxKnowYouLimitations.pptx
KnowYouLimitations.pptx
 
Easy Automated UI Testing with Canopy
Easy Automated UI Testing with CanopyEasy Automated UI Testing with Canopy
Easy Automated UI Testing with Canopy
 
Finding Your Place in the Cosmos - Azure Cosmos DB
Finding Your Place in the Cosmos - Azure Cosmos DBFinding Your Place in the Cosmos - Azure Cosmos DB
Finding Your Place in the Cosmos - Azure Cosmos DB
 
TypeScript: Beyond The Basics
TypeScript: Beyond The BasicsTypeScript: Beyond The Basics
TypeScript: Beyond The Basics
 
C# pattern matching
C# pattern matchingC# pattern matching
C# pattern matching
 
Generalist or Specialist
Generalist or SpecialistGeneralist or Specialist
Generalist or Specialist
 

Recently uploaded

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 

Recently uploaded (20)

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 

Learning Go From Hello World to Web Service.pptx

Editor's Notes

  1. I’m not a go expert Open C:\Projects\exploration\GO\MIDOTNET\TextEntryWithTimeout
  2. I’m not a go expert You are probably very good at your job. You write good code. But you may run into a situation where your services aren’t fast enough. You need a faster platform. That is where Go comes in. You can use go to build services that are fast and easy to maintain. This enables you to build software for your users that meets their needs and makes them successful.
  3. I’m not a go expert You are probably very good at your job. You write good code. But you may run into a situation where your services aren’t fast enough. You need a faster platform. That is where Go comes in. You can use go to build services that are fast and easy to maintain. This enables you to build software for your users that meets their needs and makes them successful.
  4. Batteries included, fast Modernize systems programming Concurrency Garbage Collection
  5. “The three of us got together and decided that we hated C++.” – Thompson First planned while waiting for C++ program to compile ('07) First stable released in '12
  6. CLI go mod init, mod tidy, go fmt, go build, go run, go test VS Code, Go Land
  7. Unit test runner, package manger, and formatter are built in
  8. CLI and VS Code If you don’t create a mod, you have to run the file name - go run helloWorld.go
  9. No parens, no semi-colons Func, for, if (no do or while loops)
  10. Generics only added recently
  11. In go, if the function name is capitalized, it is visible outside the module The return type can be a tuple, or 2 values
  12. VS CODE
  13. Hints Multiline imports Import “math” Math.Sin Cast to float64 – float64(i)
  14. Slices are a powerful abstraction on top of arrays Go has pointers but doesn’t allow pointer arithmatic
  15. The size is part of the type
  16. Slices store data in an underlying array
  17. The low end of the range is inclusive, the high end is exclusive
  18. Interfaces are the only abstract data type
  19. https://github.com/golang/go/blob/master/src/runtime/slice.go
  20. Go has structural-typing The programmer doesn’t have to declare and a struct is a reader, it just needs to implement the io.Reader and io.ByteReader inerfaces
  21. Todo – clone existing repo
  22. TODO Show how to write to a file
  23. Goroutine Managed by go runtime Channel Select Allow goroutine to read from channel(s)
  24. GoRoutinesDemo
  25. Channel Select Allow goroutine to read from channel(s)
  26. Go’s select lets you wait on multiple channel operations.
  27. Channel Select Allow goroutine to read from channel(s)
  28. If you get do
  29. See HelloNetHttp
  30. defer statements delay the execution of the function or method or an anonymous method until the nearby functions returns Defer is used to ensure that a function call is performed later in a program’s execution, usually for purposes of cleanup. defer is often used where e.g. ensure and finally would be used in other languages.
  31. If you get do