Giter Club home page Giter Club logo

backend-with-golang's Introduction

BACKEND WITH GO

Installation

MacOS using Homebrew

To install Go on MacOS using the terminal you can use the following command (in case you have previously installed homebrew).

  brew install go

Windows using Chocolatey

To install Go on Windows using PowerShell you can use the following command (in case you have previously installed Chocolatey).

  choco install -y golang

Linux using apt

To install Go on Ubuntu using the terminal you can use the following command.

  sudo apt install golang-go

Download Go

To download and install Go from the documentation, you can access the link below.

Download Go

Check installed Go version

Run the following command to check the installed version.

  go version

Note

The Go tool suite is made up of several different commands and sub-commands. A list of those commands is available by typing:

go help

⬆ Back to top

Introduction

What is Go?

Golang Logo

Go is an open-source programming language focused on simplicity, reliability, and efficiency. Go was originally designed at Google in 2007 by Rob Pike, and Ken Thompson and became an open-source project publicly in 2012. At the time, Google was growing quickly, and the code being used to manage its infrastructure was also growing quickly in both size and complexity. Programmers began to feel that this large and complex codebase was slowing them down so they decided that they needed a new programming language focused on simplicity and quick performance.



Go is also a compiled and concurrent programming language, its syntax is a mix between C and Python. It is also statically typed, which means that the variable type cannot change its type throughout the program (it isn't necessary to declare the type, meaning it is dynamically typed or uses duck typing). It doesn't use the “;” but it does use curly braces to define a block of code. It stands out at the level of concurrency, in Go there are no threads as such but there are "Goroutines" that are lighter threads (this helps optimize resources). It is more of a systems language than of applications. It's more useful for the Backend (at microservices or data processing). It allows object-oriented programming but not in the conventional way, it has no inheritance, and polymorphism will be done through interfaces. It doesn't have exceptions which adds unnecessary complexity.


Why using Go?

  1. Is fast and cross-platform compatible: As a compiled language, Go written code is directly translated into formats that a processor understands and runs directly. Go has been proven to be generally faster than languages like Java and Python, which enhances the availability and reliability of services. Furthermore, it is possible to compile a single Go codebase into multiple operating systems (Eg. Windows, Linux, and macOS) and hardware architectures (Eg. x86, ARM, etc.).
  2. Is easy to learn: Using Go is easy for software developers, particularly if they already have a solid foundation in C or Java. While the keywords and syntax may slightly differ, Go has the same procedural approach that programmers would familiarize in no time.
  3. Is well-scaled: What makes Go a scalable language is its ability to support concurrency. It has Goroutines, which are functions that can run simultaneously and independently. Goroutines take up only 2 kB of memory, which makes them scalable when the need for running multiple concurrent processes arises.
  4. Has static typing: Go’s method of storing variable values is more efficient than other languages which provides a higher memory and performance. If you define an int 32 variable in Go it takes four bytes of memory.
  5. Comprehensive programming tools: As an open-source initiative, there are no issues in getting the necessary development tools. There are various editors, IDEs, and plugins that can be downloaded to start with this language.
  6. Rich Standard Library: Go comes with a powerful standard library that offers a variety of tools for building applications. It includes packages for tasks like networking, working with time, manipulating strings, format I/O, and more, reducing the need for external dependencies.
  7. Built-in Testing and Benchmarking: Go includes a built-in testing package that enables developers to create automated tests for their code without the explicit need to depend on third-party frameworks. The testing package also provides benchmarking features, allowing developers to measure and compare the performance of their code.
  8. Go Doc Comments: In Go, you can document your code by adding comments before functions and declarations. By utilizing the go/doc package, you can generate documentation effortlessly. Furthermore, a web version of the documentation for public packages is automatically generated and hosted on pkg.go.dev.

⬆ Back to top

Syllabus

🐾 First steps 🐾
🍼 The basics 🍼

🦫 Hello World!

🦫 Variables and data types

🦫 Println function

🦫 Operators

🦫 Sequence of values

🦫 Reading values

🔁 Flow controls 🔁

🦫 Conditionals

🦫 Switch

🦫 Loops

🦫 Break and Continue

🛠️ Functions and pointers 🛠️

🦫 Declaring functions

🦫 Anonymous functions

🦫 Panic functions

🦫 Recursive functions

🦫 Variadic functions

🦫 Recover functions

🦫 Pointers

🛠️ Data structures 🛠️

🦫 Arrays

🦫 Slices

🦫 Maps

⚙️ Structs, enums and interfaces ⚙️

🦫 Structs

🦫 Enums

🦫 Interfaces

🦫 Access modifiers

📦 Packages 📦

🦫 Create a package

🦫 Documentation

🦫 Imports

🦫 Main

🦫 Core packages

🦫 Code examples

🧰 Backend 🧰
⊱ Databases ⊰

🦫 SQL

🦫 NoSQL

🦫 Normalization rules

🦫 MySQL

🦫 PostgreSQL

🦫 MongoDB

🦫 GORM

📡 API 📡

🦫 REST

🦫 SOAP

🦫 Authentication

👾 Caching 👾

🦫 CDN

🦫 Server Side

🦫 Client Side

🧪 Testing 🧪

🦫 Testing principle

🦫 Logs, errors and performance

🦫 Unit testing

🦫 Integration test

🦫 Code examples


⬆ Back to top

Contributors

Eduardo as Gopher Daniela as Gopher

backend-with-golang's People

Contributors

lara-vel-dev avatar edudn avatar pchaparro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.