Skip to content

fromcaio/learn-go

Repository files navigation

Learn Go (Golang) Go 🚀

Welcome to the learn-go repository! This project was originally created as course material to teach the Go programming language. I've decided to leave it public as a resource for anyone interested in learning Go.

The repository is structured into sequential folders, each covering a specific topic, from the very basics to more advanced concepts like building a RESTful API.


How to Use This Repository

This repository is structured for simplicity. Almost every .go file inside the topic folders (00 to 14) is a self-contained example with its own main function.

To avoid the complexity of creating separate modules for each example, please follow these steps to run any file:

  1. Choose an example you'd like to run from one of the folders (e.g., 01-variaveis/01-declaracao-de-variaveis.go).

  2. Copy the entire content of that file.

  3. Paste the content into the main.go file located in the root of this repository, completely replacing what's there.

  4. Open your terminal in the repository's root directory and execute the following command:

    go run main.go

Important Note on Language

Please be aware that the code comments are written in a mix of Portuguese (pt-br) and English.


Prerequisites

Before you start, make sure you have Go installed on your machine. If you don't, you can download and find installation instructions on the official website.


Course Content

The repository is organized by topic in the following order:

  • 00-introducao: Basic syntax, compilation, and execution.
  • 01-variaveis: Declaring variables and constants.
  • 02-saida-de-dados: Printing data to the console (Print, Println, Printf).
  • 03-tipos-de-dados: Go's fundamental data types (integers, floats, strings, booleans).
  • 04-arrays: Working with fixed-size arrays.
  • 05-slices: Using dynamic arrays (slices), including capacity, length, and manipulation.
  • 06-operadores: Arithmetic, assignment, comparison, logical, and binary operators.
  • 07-condicionais: if, else, else if, and switch statements.
  • 08-loops: for loops, including break and continue.
  • 09-funcoes: Defining, calling, and returning values from functions.
  • 10-structs-and-maps: Working with custom data structures (structs) and key-value pairs (maps).
  • 11-modules: Creating and using Go modules.
  • 12-workspaces: Managing multiple modules with Go workspaces.
  • 13-relation-data-base: Connecting to and querying a relational database.
  • 14-restful-api: Building a simple RESTful API.

Happy coding! ✨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages