Go (Golang) Tutorial #1 - Introduction & Setup

Net Ninja · Beginner ·🔧 Backend Engineering ·5y ago
Skills: API Design60%

Key Takeaways

This video tutorial introduces the Go programming language, its features, and setup, including installation, and configuration in VS Code, with a focus on building a command line program.

Full Transcript

hey there gang and welcome to your very first go tutorial [Music] all right then so first of all what is go also known as golang well according to the go website go is a fast statically typed compiled language but what does that all mean well first of all compiled means that go is compiled down into machine level code that computers understand so it doesn't need to be interpreted one line at a time and that's one of the reasons it's so fast compared to interpreted languages like python now statically typed means that our variable types are checked before and time by the compiler so type errors are picked up earlier it's also a strongly typed language meaning our variable types cannot change after they've been declared so if you were to make a variable a string it must always be a string in the future it can't change into a number or a boolean or any other data type now go is also a general purpose language meaning that it can be used for many different things from building web apps and rest apis to cloud services so there's a bit of something for every developer it's also got built-in testing support into its standard library so there's no need to add any extra dependencies to write your test which is a nice bonus and finally go is an object-oriented language but not as you might know we don't use classes or constructors in go to create objects however it does use features like custom types structs and interfaces that mirror that kind of functionality so it is an object-oriented language just not in the same way as a lot of other programming languages now before you start this course i do assume that you already know the foundations of any other programming language whether that's javascript python or something else entirely and i only assume that you know the absolute basics if you understand what variables functions arrays and loops are then you're probably in a good position to learn go if not then definitely check out my javascript for beginners tutorial first of all to learn the basics of programming in general the link to that is going to be down below the video so in this series we're going to be building a fun little command line program which can be used to create and save bills for a cafe or a restaurant or something like that so we're going to be able to interact with the command line to create a new bill and we can give that bill a name we could then add multiple items to that bill and then if we wanted to we could add a tip to the bill as well and then finally we can save the bill which is gonna generate a text file for us with that bill correctly formatted including the total at the bottom and by creating this program you're going to learn most of the building blocks of the go language like how to use slices maps structs receiver functions pointers and all that jazz all right then so first things first you need to install go on your computer pretty simple to do head to golang.org the link to this is down below then click on download go and you want to choose which version to download depending on your operating system once you've downloaded it run the installer now it should automatically add go to your path environment variable on your computer but if there's an option to add it just make sure that option is checked anyway once it's installed you want to open up a terminal to check the installation and to do that all we need to do is type go and hit enter if it gives us all of these different options back then we know that go has successfully installed if not there's been some problem with the installation and you will need to re-install it but now we have go installed we can go ahead and start using it on our computer the first thing i'm going to do is open up a folder just an empty folder in vs code this is where we're going to do all of our work all right then so there is a package that you should install first of all for go support in vs code and that package is just called go so type go right here and it's this one so click on install first of all that should install pretty quickly once it's installed go ahead over here and just create a new file and i'm going to call this test dot go so it has a dot go extension and press enter now when you do that you're probably going to see these pop-ups right here so what i'm going to do where it says gopls i'm going to install all of these right here and i'm also going to click on this one install all so make sure you do that as well to get the full support inside vs code for go files and then once that's done vs code is ready and set up to work with go files now before we quit this video i just want to show you how to access all of the course files so the right over here on my github repo called golang tutorials the link to this is going to be down below the video and every lesson has its own branch in this repo because every lesson has its own code so if you want to see the code for lesson 10 for example you'd go to the branch drop down go to lesson 10 to select that lesson and you're gonna see the main.go file right here all of the code is inside that if you want to download it you can go to this code button and then download a zip file which is going to include this file and any other files that might be included in different lessons so now all of that intro and setup is out of the way let's start writing go code now if you want to watch this whole course without youtube adverts you can do i've uploaded it to the net ninja website which you can find at netninja.dev so you can buy this course for two dollars or you can access all of my courses including premium courses not found on youtube for nine dollars a month by signing up to net ninja pro and the first month is half price when you use this promo code right here anyway i'll leave this link down below in case you want to buy it now otherwise guys don't forget to share subscribe and like and i'm going to see you in the very next tutorial

Original Description

Hey gang, in this Go tutorial series you'll learn what Go is (a statically typed programming language) & how to use it to create a simple program. Along the way you'll learn about types (string, ints, floats, maps etc) user input and how to make custom data types using structs. 🐱‍👤 View this course in full without ads on Net Ninja Pro: https://netninja.dev/p/learn-go-golang 🐱‍💻 Course Files: + https://github.com/iamshaunjp/golang-tutorials 🐱‍👤 JOIN THE YOUTUBE NET NINJA GANG - https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg/join 🐱‍💻 🐱‍💻 My Udemy Courses: + Modern JavaScript - https://www.thenetninja.co.uk/udemy/modern-javascript + Vue JS 3 & Firebase - https://www.thenetninja.co.uk/udemy/vue-and-firebase + D3.js & Firebase - https://www.thenetninja.co.uk/udemy/d3-and-firebase 🐱‍💻 Useful playlists: + Modern JavaScript - https://www.youtube.com/watch?v=iWOYAxlnaww&list=PL4cUxeGkcC9haFPT7J25Q9GRB_ZkFrQAc 🐱‍💻 Download Go - https://golang.org/dl/ 🐱‍💻 Go Numeric Types (bits) - https://golang.org/ref/spec#Numeric_types 🐱‍💻 Go Standard Library (bits) - https://golang.org/pkg/ 🐱‍💻 VS Code - https://code.visualstudio.com/ 🐱‍💻 Social Links: Facebook - https://www.facebook.com/thenetninjauk Twitter - https://twitter.com/thenetninjauk Instagram - https://www.instagram.com/thenetninja/
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Net Ninja · Net Ninja · 0 of 60

← Previous Next →
1 Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
2 Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
3 Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
4 GraphQL Tutorial #1 - Introduction to GraphQL
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
5 GraphQL Tutorial #2 - A Birdseye View of GraphQL
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
6 GraphQL Tutorial #3 - Project (stack) Overview
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
7 GraphQL Tutorial #4 - Making Queries (front-end preview)
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
8 GraphQL Tutorial #5 - Express App Setup
GraphQL Tutorial #5 - Express App Setup
Net Ninja
9 GraphQL Tutorial #6 - Setting up GraphQL
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
10 GraphQL Tutorial #7 - GraphQL Schema
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
11 GraphQL Tutorial #8 - Root Query
GraphQL Tutorial #8 - Root Query
Net Ninja
12 GraphQL Tutorial #9 - The Resolve Function
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
13 GraphQL Tutorial #10 - Testing Queries in Graphiql
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
14 GraphQL Tutorial #11 - GraphQL ID Type
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
15 GraphQL Tutorial #12 - Author Type
GraphQL Tutorial #12 - Author Type
Net Ninja
16 GraphQL Tutorial #13 - Type Relations
GraphQL Tutorial #13 - Type Relations
Net Ninja
17 GraphQL Tutorial #14 - GraphQL Lists
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
18 GraphQL Tutorial #15 - More on Root Queries
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
19 GraphQL Tutorial #16 - Connecting to mLab
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
20 GraphQL Tutorial #17 - Mongoose Models
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
21 GraphQL Tutorial #18 - Mutations
GraphQL Tutorial #18 - Mutations
Net Ninja
22 GraphQL Tutorial #19 - More on Mutations
GraphQL Tutorial #19 - More on Mutations
Net Ninja
23 GraphQL Tutorial #20 - Updating the Resolve Functions
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
24 GraphQL Tutorial #21 - GraphQL NonNull
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
25 GraphQL Tutorial #22 - Adding a Front-end
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
26 GraphQL Tutorial #23 - Create React App
GraphQL Tutorial #23 - Create React App
Net Ninja
27 GraphQL Tutorial #24 - Book List Component
GraphQL Tutorial #24 - Book List Component
Net Ninja
28 GraphQL Tutorial #25 - Apollo Client Setup
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
29 GraphQL Tutorial #26 - Making Queries from React
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
30 GraphQL Tutorial #27 - Rendering Data in a Component
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
31 GraphQL Tutorial #28 - Add Book Component
GraphQL Tutorial #28 - Add Book Component
Net Ninja
32 GraphQL Tutorial #29 - External Query File
GraphQL Tutorial #29 - External Query File
Net Ninja
33 GraphQL Tutorial #30 - Updating Component State
GraphQL Tutorial #30 - Updating Component State
Net Ninja
34 GraphQL Tutorial #31 - Composing Queries
GraphQL Tutorial #31 - Composing Queries
Net Ninja
35 GraphQL Tutorial #32 - query variables
GraphQL Tutorial #32 - query variables
Net Ninja
36 GraphQL Tutorial #33 - Re-fetching Queries
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
37 GraphQL Tutorial #34 - Book Details Component
GraphQL Tutorial #34 - Book Details Component
Net Ninja
38 GraphQL Tutorial #36 - Styling the App
GraphQL Tutorial #36 - Styling the App
Net Ninja
39 GraphQL Tutorial #35 - Making a Single Query
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
40 Build Apps with Vue & Firebase - Udemy Course
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
41 Updated Vue & Firebase Course (Udemy)
Updated Vue & Firebase Course (Udemy)
Net Ninja
42 Vue & Firebase Real-time Chat (Preview) #1 - Intro
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
43 Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
44 Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
45 Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
46 Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
47 Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
48 Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
49 Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
50 Object Oriented JavaScript Tutorial #1 - Introduction
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
51 Object Oriented JavaScript Tutorial #2 - Object Literals
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
52 Object Oriented JavaScript Tutorial #3 - Updating Properties
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
53 Object Oriented JavaScript Tutorial #4 - Classes
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
54 Object Oriented JavaScript Tutorial #5  - Class Constructors
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
55 Object Oriented JavaScript Tutorial #6 - Class Methods
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
56 Object Oriented JavaScript Tutorial #7 - Method Chaining
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
57 Object Oriented JavaScript Tutorial #8 - Class Inheritance
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
58 Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
59 Object Oriented JavaScript Tutorial #10 - Prototype
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
60 Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja

This tutorial introduces Go, a statically typed and compiled language, and sets up a development environment in VS Code to build a command line program.

Key Takeaways
  1. Install Go from the official website
  2. Configure VS Code with the Go extension
  3. Create a new Go file and install necessary packages
  4. Access course files on GitHub
💡 Go is a fast and statically typed language that can be used for building web apps, cloud services, and command line programs.

Related Reads

Up next
Unlock CRAZY Performance: Native Code Compilation No JNI! #shorts #quarkusinsights #projectpanama
Quarkusio
Watch →