SlideShare a Scribd company logo
1 of 34
Download to read offline
GTG (Golang Taipei Gathering): 30
Introduction vgo
Evan Lin
Agenda
● Go vendoring and package management
● Introduce vgo
● vgo features
● vgo tutorial
How to write a Go application
1. We write code
2. We use other’s code
3. ow..
Reference: GopherCon 2017: Sam Boyer - The New Era of Go Package Management
Need other’s code?
`go get github.com/xxxx/xxx`
If you are lucky….
But...
Vendoring control ...
Rise of vendoring tools:
● 2013: godep, gom, et. all - 2013
● 2014: glide, gopkg, et. all - 2014
● 2015: gb, govendor, et. all - 2015
● 2017: dep (official experiment)
Reference: GopherCon 2017: Sam Boyer - The New Era of Go Package Management
About Vendoring in Go
● 2015: Go 1.5 vendor/ added, default off
● 2016: Go 1.6 vendor/ on by default
● 2017: Go 1.7 vendor/ always on
Reference: GopherCon 2017: Sam Boyer - The New Era of Go Package Management
what is vgo
● Proposed Modification to "go" Tool.
● Provide versioned concept to go tools
● Target to ship on go 1.11, will be offcial on go 1.12
● vgo has lots of features….
vgo Features
● The Import Compatibility Rule
● Semantic Import Versioning
● Minimal Version Selection
● Allow run go command outside GOPATH
● Default download code in `vgo build`
● ...
1. The Import Compatibility Rule
● 2017/06 github.com/kkdai/testGo
● 2017/08 github.com/kkdai/testGo
● 2017/12 github.com/kkdai/testGo.v2
Need backward-compatible
Breaking change
2. Semantic Import Versioning
3. Minimal Version Selection
Minimal version selection allows modules to
specify only minimum requirements for their
dependency modules.
When you want the update
your software?
● For security concern?
● Faster? Stronger?
Update your vendor code ..
Update your vendor code until you need it
Update your vendor code untill you *REALLY* need it
4. Allow run go command outside GOPATH
Allow running the go command in file trees outside GOPATH, provided there is
a go.mod in the current directory or a parent directory.
That go.mod file defines the mapping from file system to import path as well
as the specific module versions used in the build.
P.S.
● Go 1.10 set default GOPATH
● vgo (1.12?) run go command outside GOPATH
5. Default download without `go get`
● Original build process:
○ Write your own `main.go`
○ `go get` dependency module code
○ `go build`
● vgo build process:
○ Write your own `main.go`
○ `vgo build`
vgo tutorial
vgo can run go command outside GOPATH..
vgo tutorial (1):
● Install vgo
○ go get -u golang.org/x/vgo
● example code (download here)
vgo tutorial (2)
● Create go.mod
○ touch go.mod
● Build your code
vgo tutorial (3)
● Check go.mod
● Question: How to define your version?
○ It support branch and tag
■ https://github.com/bketelsen/captainhook/blob/master/go.mod#L5:2
■ https://github.com/gorilla/mux/releases/tag/v1.6.0
vgo tutorial (4)
● List all modules
vgo tutorial (5)
● List all availible version on rsc.io/quote (vgo list)
vgo tutorial (6) - Upgrade
● List all module and it latest version
vgo tutorial (7) - Upgrade
● Upgrade to latest module
vgo tutorial (8) - run test on latest module
● Try to test latest modules
vgo tutorial (9) - Downgrading
● Use `vgo get` to downgrading specific version
vgo tutorial (10) - Excluding
● Excluding specific version
1. Go & Versioning from Russ Cox
2. Youtube: Building Predictability into Your Pipeline ::
Russ Cox; Jess Frazelle, Sam Boyer, Pete Garcin
3. GopherCon 2017: Sam Boyer - The New Era of Go
Package Management
4. Using vgo for Go Dependency Management
5. Repeatable Builds with vgo
Reference:
Youtube: Building Predictability into Your Pipeline :: Russ
Cox; Jess Frazelle, Sam Boyer, Pete Garcin

More Related Content

Similar to GTG30: Introduction vgo

Modules - Go west 2018-10-02
Modules - Go west 2018-10-02Modules - Go west 2018-10-02
Modules - Go west 2018-10-02Max Ekman
 
Security of Go Modules - SF Meetup
Security of Go Modules - SF MeetupSecurity of Go Modules - SF Meetup
Security of Go Modules - SF MeetupDeep Datta
 
Understanding pseudo-version and Go1.14+ with notes
Understanding pseudo-version and Go1.14+ with notesUnderstanding pseudo-version and Go1.14+ with notes
Understanding pseudo-version and Go1.14+ with notesMitali Bisht
 
Git for work groups ironhack talk
Git for work groups ironhack talkGit for work groups ironhack talk
Git for work groups ironhack talkTiago Ameller
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.WordCamp Harare
 
Security of go modules and vulnerability scanning in GoCenter
Security of go modules and vulnerability scanning in GoCenterSecurity of go modules and vulnerability scanning in GoCenter
Security of go modules and vulnerability scanning in GoCenterDeep Datta
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoSimon Hewitt
 
Develop Android/iOS app using golang
Develop Android/iOS app using golangDevelop Android/iOS app using golang
Develop Android/iOS app using golangSeongJae Park
 
Understanding Pseudo-Versions Moving to Go 1.13 What is in Go 1.14+ for Modules
Understanding Pseudo-Versions Moving to Go 1.13 What is in Go 1.14+ for ModulesUnderstanding Pseudo-Versions Moving to Go 1.13 What is in Go 1.14+ for Modules
Understanding Pseudo-Versions Moving to Go 1.13 What is in Go 1.14+ for ModulesMitali Bisht
 
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)Evan Lin
 
Understanding pseudoversion- GolangDC
Understanding pseudoversion- GolangDCUnderstanding pseudoversion- GolangDC
Understanding pseudoversion- GolangDCMitali Bisht
 
Develop Android app using Golang
Develop Android app using GolangDevelop Android app using Golang
Develop Android app using GolangSeongJae Park
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go langAmal Mohan N
 
How to Git and Github | Hands on workshop
How to Git and Github | Hands on workshopHow to Git and Github | Hands on workshop
How to Git and Github | Hands on workshopPavitraBhagat
 

Similar to GTG30: Introduction vgo (20)

Modules - Go west 2018-10-02
Modules - Go west 2018-10-02Modules - Go west 2018-10-02
Modules - Go west 2018-10-02
 
Security of Go Modules - SF Meetup
Security of Go Modules - SF MeetupSecurity of Go Modules - SF Meetup
Security of Go Modules - SF Meetup
 
Comparing C and Go
Comparing C and GoComparing C and Go
Comparing C and Go
 
Understanding pseudo-version and Go1.14+ with notes
Understanding pseudo-version and Go1.14+ with notesUnderstanding pseudo-version and Go1.14+ with notes
Understanding pseudo-version and Go1.14+ with notes
 
Git for work groups ironhack talk
Git for work groups ironhack talkGit for work groups ironhack talk
Git for work groups ironhack talk
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.
 
Security of go modules and vulnerability scanning in GoCenter
Security of go modules and vulnerability scanning in GoCenterSecurity of go modules and vulnerability scanning in GoCenter
Security of go modules and vulnerability scanning in GoCenter
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Develop Android/iOS app using golang
Develop Android/iOS app using golangDevelop Android/iOS app using golang
Develop Android/iOS app using golang
 
Understanding Pseudo-Versions Moving to Go 1.13 What is in Go 1.14+ for Modules
Understanding Pseudo-Versions Moving to Go 1.13 What is in Go 1.14+ for ModulesUnderstanding Pseudo-Versions Moving to Go 1.13 What is in Go 1.14+ for Modules
Understanding Pseudo-Versions Moving to Go 1.13 What is in Go 1.14+ for Modules
 
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
 
Gerrit Code Review
Gerrit Code ReviewGerrit Code Review
Gerrit Code Review
 
Understanding pseudoversion- GolangDC
Understanding pseudoversion- GolangDCUnderstanding pseudoversion- GolangDC
Understanding pseudoversion- GolangDC
 
Intro. to Git and Github
Intro. to Git and GithubIntro. to Git and Github
Intro. to Git and Github
 
Untangling4
Untangling4Untangling4
Untangling4
 
Develop Android app using Golang
Develop Android app using GolangDevelop Android app using Golang
Develop Android app using Golang
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
How to Git and Github | Hands on workshop
How to Git and Github | Hands on workshopHow to Git and Github | Hands on workshop
How to Git and Github | Hands on workshop
 

More from Evan Lin

好書分享: 一人公司 Company Of One
好書分享:  一人公司  Company Of One好書分享:  一人公司  Company Of One
好書分享: 一人公司 Company Of OneEvan Lin
 
How to master a programming language: a Golang example"
How to master a programming language: a Golang example"How to master a programming language: a Golang example"
How to master a programming language: a Golang example"Evan Lin
 
Golang taipei #45 10th birthday
Golang taipei #45 10th birthdayGolang taipei #45 10th birthday
Golang taipei #45 10th birthdayEvan Lin
 
How I become Go GDE
How I become Go GDEHow I become Go GDE
How I become Go GDEEvan Lin
 
iThome Modern Web 2018: 如何打造高效的機器學習平台
iThome Modern Web 2018: 如何打造高效的機器學習平台iThome Modern Web 2018: 如何打造高效的機器學習平台
iThome Modern Web 2018: 如何打造高效的機器學習平台Evan Lin
 
Kubernetes secret introduction
Kubernetes secret introductionKubernetes secret introduction
Kubernetes secret introductionEvan Lin
 
Consistent hashing algorithmic tradeoffs
Consistent hashing  algorithmic tradeoffsConsistent hashing  algorithmic tradeoffs
Consistent hashing algorithmic tradeoffsEvan Lin
 
Kubernetes v.s. mesos
Kubernetes v.s. mesosKubernetes v.s. mesos
Kubernetes v.s. mesosEvan Lin
 
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...iThome Cloud Summit: The next generation of data center: Machine Intelligent ...
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...Evan Lin
 
iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人
iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人
iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人Evan Lin
 
Google APAC Machine Learning Expert Day
Google APAC Machine Learning Expert DayGoogle APAC Machine Learning Expert Day
Google APAC Machine Learning Expert DayEvan Lin
 
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line BotEvan Lin
 
Use go channel to write a disk queue
Use go channel to write a disk queueUse go channel to write a disk queue
Use go channel to write a disk queueEvan Lin
 
Gopher Taiwan Gathering #16: Build a smart bot via Golang
Gopher Taiwan Gathering #16:  Build a smart bot via GolangGopher Taiwan Gathering #16:  Build a smart bot via Golang
Gopher Taiwan Gathering #16: Build a smart bot via GolangEvan Lin
 
Docker swarm introduction
Docker swarm introductionDocker swarm introduction
Docker swarm introductionEvan Lin
 
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangEvan Lin
 
Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot Evan Lin
 
Docker introduction in Hardware Company
Docker introduction in Hardware CompanyDocker introduction in Hardware Company
Docker introduction in Hardware CompanyEvan Lin
 
Host Line Bot with Golang
Host Line Bot with GolangHost Line Bot with Golang
Host Line Bot with GolangEvan Lin
 

More from Evan Lin (20)

好書分享: 一人公司 Company Of One
好書分享:  一人公司  Company Of One好書分享:  一人公司  Company Of One
好書分享: 一人公司 Company Of One
 
How to master a programming language: a Golang example"
How to master a programming language: a Golang example"How to master a programming language: a Golang example"
How to master a programming language: a Golang example"
 
Golang taipei #45 10th birthday
Golang taipei #45 10th birthdayGolang taipei #45 10th birthday
Golang taipei #45 10th birthday
 
How I become Go GDE
How I become Go GDEHow I become Go GDE
How I become Go GDE
 
iThome Modern Web 2018: 如何打造高效的機器學習平台
iThome Modern Web 2018: 如何打造高效的機器學習平台iThome Modern Web 2018: 如何打造高效的機器學習平台
iThome Modern Web 2018: 如何打造高效的機器學習平台
 
Kubernetes secret introduction
Kubernetes secret introductionKubernetes secret introduction
Kubernetes secret introduction
 
Consistent hashing algorithmic tradeoffs
Consistent hashing  algorithmic tradeoffsConsistent hashing  algorithmic tradeoffs
Consistent hashing algorithmic tradeoffs
 
Kubernetes v.s. mesos
Kubernetes v.s. mesosKubernetes v.s. mesos
Kubernetes v.s. mesos
 
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...iThome Cloud Summit: The next generation of data center: Machine Intelligent ...
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...
 
iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人
iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人
iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人
 
Google APAC Machine Learning Expert Day
Google APAC Machine Learning Expert DayGoogle APAC Machine Learning Expert Day
Google APAC Machine Learning Expert Day
 
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
 
Use go channel to write a disk queue
Use go channel to write a disk queueUse go channel to write a disk queue
Use go channel to write a disk queue
 
Gopher Taiwan Gathering #16: Build a smart bot via Golang
Gopher Taiwan Gathering #16:  Build a smart bot via GolangGopher Taiwan Gathering #16:  Build a smart bot via Golang
Gopher Taiwan Gathering #16: Build a smart bot via Golang
 
Docker swarm introduction
Docker swarm introductionDocker swarm introduction
Docker swarm introduction
 
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
 
Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot
 
Docker introduction in Hardware Company
Docker introduction in Hardware CompanyDocker introduction in Hardware Company
Docker introduction in Hardware Company
 
Host Line Bot with Golang
Host Line Bot with GolangHost Line Bot with Golang
Host Line Bot with Golang
 
Project52
Project52Project52
Project52
 

Recently uploaded

Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 

Recently uploaded (20)

Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 

GTG30: Introduction vgo

  • 1. GTG (Golang Taipei Gathering): 30 Introduction vgo Evan Lin
  • 2. Agenda ● Go vendoring and package management ● Introduce vgo ● vgo features ● vgo tutorial
  • 3. How to write a Go application 1. We write code 2. We use other’s code 3. ow.. Reference: GopherCon 2017: Sam Boyer - The New Era of Go Package Management
  • 4. Need other’s code? `go get github.com/xxxx/xxx`
  • 5. If you are lucky….
  • 8. Rise of vendoring tools: ● 2013: godep, gom, et. all - 2013 ● 2014: glide, gopkg, et. all - 2014 ● 2015: gb, govendor, et. all - 2015 ● 2017: dep (official experiment) Reference: GopherCon 2017: Sam Boyer - The New Era of Go Package Management
  • 9. About Vendoring in Go ● 2015: Go 1.5 vendor/ added, default off ● 2016: Go 1.6 vendor/ on by default ● 2017: Go 1.7 vendor/ always on Reference: GopherCon 2017: Sam Boyer - The New Era of Go Package Management
  • 10. what is vgo ● Proposed Modification to "go" Tool. ● Provide versioned concept to go tools ● Target to ship on go 1.11, will be offcial on go 1.12 ● vgo has lots of features….
  • 11. vgo Features ● The Import Compatibility Rule ● Semantic Import Versioning ● Minimal Version Selection ● Allow run go command outside GOPATH ● Default download code in `vgo build` ● ...
  • 12. 1. The Import Compatibility Rule ● 2017/06 github.com/kkdai/testGo ● 2017/08 github.com/kkdai/testGo ● 2017/12 github.com/kkdai/testGo.v2 Need backward-compatible Breaking change
  • 13. 2. Semantic Import Versioning
  • 14. 3. Minimal Version Selection Minimal version selection allows modules to specify only minimum requirements for their dependency modules.
  • 15. When you want the update your software? ● For security concern? ● Faster? Stronger?
  • 17. Update your vendor code until you need it
  • 18. Update your vendor code untill you *REALLY* need it
  • 19. 4. Allow run go command outside GOPATH Allow running the go command in file trees outside GOPATH, provided there is a go.mod in the current directory or a parent directory. That go.mod file defines the mapping from file system to import path as well as the specific module versions used in the build. P.S. ● Go 1.10 set default GOPATH ● vgo (1.12?) run go command outside GOPATH
  • 20. 5. Default download without `go get` ● Original build process: ○ Write your own `main.go` ○ `go get` dependency module code ○ `go build` ● vgo build process: ○ Write your own `main.go` ○ `vgo build`
  • 22. vgo can run go command outside GOPATH..
  • 23. vgo tutorial (1): ● Install vgo ○ go get -u golang.org/x/vgo ● example code (download here)
  • 24. vgo tutorial (2) ● Create go.mod ○ touch go.mod ● Build your code
  • 25. vgo tutorial (3) ● Check go.mod ● Question: How to define your version? ○ It support branch and tag ■ https://github.com/bketelsen/captainhook/blob/master/go.mod#L5:2 ■ https://github.com/gorilla/mux/releases/tag/v1.6.0
  • 26. vgo tutorial (4) ● List all modules
  • 27. vgo tutorial (5) ● List all availible version on rsc.io/quote (vgo list)
  • 28. vgo tutorial (6) - Upgrade ● List all module and it latest version
  • 29. vgo tutorial (7) - Upgrade ● Upgrade to latest module
  • 30. vgo tutorial (8) - run test on latest module ● Try to test latest modules
  • 31. vgo tutorial (9) - Downgrading ● Use `vgo get` to downgrading specific version
  • 32. vgo tutorial (10) - Excluding ● Excluding specific version
  • 33. 1. Go & Versioning from Russ Cox 2. Youtube: Building Predictability into Your Pipeline :: Russ Cox; Jess Frazelle, Sam Boyer, Pete Garcin 3. GopherCon 2017: Sam Boyer - The New Era of Go Package Management 4. Using vgo for Go Dependency Management 5. Repeatable Builds with vgo Reference:
  • 34. Youtube: Building Predictability into Your Pipeline :: Russ Cox; Jess Frazelle, Sam Boyer, Pete Garcin