Curso Go Programming
24 HorasVisão Geral
Curso Go Programming A linguagem de programação Go (também conhecida como Golang) é amplamente usada no Google (que convidou a linguagem) e está crescendo em popularidade para o desenvolvimento do lado do servidor (incluindo microsserviços).
Nosso Curso Go Programming, lhe dará uma introdução a esta popular linguagem de programação e mostrará como aplicar programação funcional baseada em objetos e técnicas de simultaneidade.
Este curso também serve como uma base sólida para avançar para o desenvolvimento de servidores da web baseados em Go, serviços Go, microsserviços Go etc.
Objetivo
Após realizar este Curso Go Programming você será capaz de:
- Aprendeu sobre a linguagem de programação Core Go
- Compreendeu os principais conceitos da linguagem Go
- Funções exploradas em Go
- Aprendeu sobre programação baseada em objetos em Go
- Métodos de definição explorados
- Interfaces Go examinadas
- Entendeu a abordagem Go para tratamento de erros
- Trabalhou com Goroutines e Canais
- Explorou o gerenciamento de simultaneidade com dados compartilhados
- Pacotes Go Explorados e a Ferramenta Go
- Usou a ferramenta de teste go
- Desenvolveu um servidor simples baseado em TCP
- Criou um serviço RESTful usando Go
Publico Alvo
Este curso é ideal para qualquer desenvolvedor de software que deseja desenvolver aplicativos e serviços Go.
Pre-Requisitos
Nenhum conhecimento prévio de Go é necessario; embora seja necessário o conhecimento de uma ou mais linguagens de programação de computador modernas, como C, C ++, Java, JavaScript, C # ou Python. Nenhuma Programação Orientada
Materiais
Português/InglêsConteúdo Programatico
Welcome and Introductions
- Introduction to tutor
- Introduction to Delegates
- Overview of the Course
Go Overview and Hello World
- Go Introduction
- Go Versions
- Why Go?
- Installing Go
- Go Editors and IDEs
- Visual Studio and Go
- Hello World in Go
- Adding Initialization Behaviour
- Accessing Command Line Arguments
- Go Programs Consist of
- Noteworthy Omissions from Go
Go Programming Core Elements
- Go Tokens
- Variables
- Assignments
- Short Variable Declarations
- Arithmetic Operators
- Constants
- Pointers
- Strings
- fmt.Printf() formatting
- Relational, Logical and Bitwise operators
- Operator Precedence
Flow of Control in Go
- Relational Operators
- If statement
- Using else and else if
- Nesting if statements
- Logical Operators
- Switch Statement
- expression switch
- type switch
- For loops
- Nested for Loops
- while style for loops
- Break, Continue and Goto
Data Types
- Go Data Types
- Numbers
- Arrays
- Slices
- Ranges
- Maps
- Containers
- List and Ring
Functions
- Defining Functions
- Zero, single and multiple parameter functions
- Returning values
- Variadic parameter lists
- Call by Reference
- Anonymous Functions
- Defering a Function call
- Panic and Recover
- Higher Order Functions
- Closure
- Recursion
Structs: Object-based Programming
- Struct Introduction
- Defining a Struct
- Variables of type struct Person
- Initializing Structs
- Comparing Structs
- Structs are value types
- Passing Structs to Functions
- Defining Constructor Functions
- JSON and Structs
- Anonymous Structs
- Adding Behaviour
Interfaces
- interface Introduction
- Defining an interface
- Creating User Defined Interface
- Implementing an Interface
- Using an Interface Type
- Working with interfaces
- Built-in Interfaces
- Stringer and Interface
- The empty interface: interface {}
Embedded Types
- Embedded Type Introduction
- Embedded Structs
- Multiple Embedded Structs
- Embedded Interfaces
- Multi-Embedded Interfaces
- Embedded Interfaces in Interfaces
- Embedded Multi-Interfaces in Interfaces
- Multi-Embedded Structs and Interfaces
Error Handling
- Error Handling Introduction
- Basics of Error Handling
- Returning an Error
- Custom Error Types
- Handling Errors Idiom
Packages and Modules
- Packages
- Go Packages
- Installing Packages
- Importing a Package
- Defining Packages
- importing Custom Packages
- Installing Packages
- Package Initialization
- Modules
Goroutines
- Why Asynchronous Programming
- Goroutine Introduction
- Executing Goroutines
- Simple Goroutine Example
- Wait for Goroutine to finish
- WaitGroup
Channels
- Problems with Concurrency
- Communicating via Channels
- Channel Hello World
- Sending Complex messages
- Channel Buffering
- Channel Directions
- Closing Channels
- Channel Select
- Range Over Channels
- Timers
- Tickers
Testing
- Introduction to Go Testing
- Package testing
- Test Functions
- Parametric Tests
- Benchmark Tests
- Skipping Tests
- Test Setup / Shutdown behaviour
- Verifying Examples
- Subtests
RESTful services with Go
- REST Design Pattern
- Basic net/http package
- RESTful API
- Gorilla/mux
- PathPrefix Subrouter
- Handling Path Parameters
- Handling Query Parameters
- Return objects as JSON
- Posting Data
- Organising Your Code
Optional Modules
These optional topics may be included in a customised course - for instance if you want to swap topics from the above syllabus, or to expand your Go training programme.
Files and Paths
- File Information
- Checking if a file exists
- Obtaining a file reference
- File Permissions
- Reading Files
- Writing Data to Files
- Renaming and Deleting files
- Random Access Files
- Paths
- Directories
- Temporary Files & Directories
Further Channels
- Channel Synchronization
- Timeouts
- Non-Blocking Channel Operations
- Worker pools
- Rate Limiting
Concurrency using the sync Package
- Once
- Atomic Counters
- Mutual Exclusion Locks
- Locker, Mutex / RWMutex
- Pool
- Stateful Goroutines
- Cond
Go and Relational Databases
- Examples of Relational Databases
- MySQL
- Connecting to an SQL Database
- Query a Database
- Insert into the Database
- Update a row in the Database
- Delete a row in the Database
- Transaction Handling
Go and MongoDB
- NoSQL Databases
- SQL v NoSQL
- Examples of NoSQL Databases
- MongoDB
- Installing mongodb driver
- Connecting to MongoDB database
- Create a Collection
- Inserting into a Collection
- Find Documents in Collections
- Update Documents
- Delete Documents