<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Go Tutorial - Learn Go from the Basics with Code Examples on golangbot.com</title>
    <link>https://golangbot.com/</link>
    <description>Recent content in Go Tutorial - Learn Go from the Basics with Code Examples on golangbot.com</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Wed, 24 Sep 2025 19:40:00 +0000</lastBuildDate><atom:link href="https://golangbot.com/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>My GopherCon UK 2025 talk</title>
      <link>https://golangbot.com/testing-pyramid-gopherconuk-2025/</link>
      <pubDate>Fri, 19 Sep 2025 15:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/testing-pyramid-gopherconuk-2025/</guid>
      <description>
        
          
            My GopherCon UK 2025 talk Climbing the Testing Pyramid: From Real Service to Interface Mocks in Go can be watched on youtube.
This is the first time I am speaking at GopherCon and also in front of a large audience of nearly 150 people.
This talk explores the various strategies for unit testing Go applications that interact with cloud services like S3. Testing against real cloud services is considered the gold standard, but it’s often impractical due to access restrictions, cloud costs and the difficulty of reliably simulating failure scenarios such as network partitions.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Unit testing using mocks in Go</title>
      <link>https://golangbot.com/unit-testing-using-mock-go/</link>
      <pubDate>Thu, 10 Apr 2025 15:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/unit-testing-using-mock-go/</guid>
      <description>
        
          
            Why mocks are needed? I generally prefer testing my code without using mocks. For example, if the code is integrated with Elastic Search, I prefer to run a elastic search container locally and test the Go code against that container. But there are some cases where creating a local environment for testing is not possible. This usually happens when integrating with cloud providers. Let&amp;rsquo;s take the case where the code is creating a AWS s3 bucket.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Use of omitzero json struct tag in Go</title>
      <link>https://golangbot.com/omitzero-go/</link>
      <pubDate>Sat, 08 Mar 2025 23:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/omitzero-go/</guid>
      <description>
        
          
            Go 1.24 introduced a new json struct tag called omitzero. It handles a couple of scenarios that the existing omitempty tag couldn&amp;rsquo;t. Let&amp;rsquo;s look at them one by one.
Marshalling empty time.Time struct fields Let&amp;rsquo;s say we have the following customer struct
1type customer struct { 2	Name string `json:&amp;#34;name,omitempty&amp;#34;` 3	DOB time.Time `json:&amp;#34;dob,omitempty&amp;#34;` 4} We have added the omitempty json struct tag to both the Name and DOB fields with the expectation that if the field is not set, that particular field must be removed when the json is created.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Creating Validating Admission Controller in Kubernetes using Go</title>
      <link>https://golangbot.com/go-kubernetes-validating-admission-controller/</link>
      <pubDate>Sat, 03 Aug 2024 00:45:00 +0000</pubDate>
      
      <guid>https://golangbot.com/go-kubernetes-validating-admission-controller/</guid>
      <description>
        
          
            Admission Controllers Admission controllers provide a mechanism to validate or modify Kubernetes object creation requests before the object is actually created. This definition might not make complete sense right now but we will be able to understand what this means as the tutorial progresses, so don&amp;rsquo;t worry about it :).
There are two kinds of admission controllers in Kubernetes.
Validating admission controller Mutating admission controller Let&amp;rsquo;s try to understand each of them by means of an example.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Go WebSocket Tutorial</title>
      <link>https://golangbot.com/go-websocket-server/</link>
      <pubDate>Thu, 01 Feb 2024 00:10:00 +0000</pubDate>
      
      <guid>https://golangbot.com/go-websocket-server/</guid>
      <description>
        
          
            What are WebSockets and what are their advantages over traditional HTTP? HTTP is simply a request response protocol. This means a client such as a web browser sends a request and the server works on this request and sends a response. This request and response uses a TCP connection underneath. Once the response is received, the TCP connection is closed and can&amp;rsquo;t be reused. The client has to initiate a new TCP connection if it wants to make a new request.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Migrating from Ghost to Hugo</title>
      <link>https://golangbot.com/migrate-ghost-hugo/</link>
      <pubDate>Tue, 07 Nov 2023 02:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/migrate-ghost-hugo/</guid>
      <description>
        
          
            Why migrate to Hugo? Why migrate golangbot.com from Ghost to Hugo is the first question that will pop in your mind when you read this post. golangbot.com is 6 years old and it has been powered by Ghost since its inception. Ghost has stood the test of time and it has served me well. Why migrate to Hugo then? Well I have my own reasons.
Ghost doesn&amp;rsquo;t support SQLite anymore Ghost has been supporting SQLite and MySQL as the backend store.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Contexts - Cancellation, Timeout and Propagation</title>
      <link>https://golangbot.com/context-timeout-cancellation/</link>
      <pubDate>Sat, 29 Apr 2023 10:28:15 +0000</pubDate>
      
      <guid>https://golangbot.com/context-timeout-cancellation/</guid>
      <description>
        
          
            What is a context? Context is a package in the standard library which is mainly used to propagate cancellation signals from one function to another or even from micro service to another. Let&amp;rsquo;s consider the example of a user sending a get request to a web server to download 50 images, zip it and send the zipped response back. The request has been triggered from the browser and let&amp;rsquo;s say it takes 70 seconds to complete.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Error Wrapping</title>
      <link>https://golangbot.com/error-wrapping/</link>
      <pubDate>Tue, 11 Oct 2022 22:54:11 +0000</pubDate>
      
      <guid>https://golangbot.com/error-wrapping/</guid>
      <description>
        
          
            Welcome to tutorial no. 32 in our Golang tutorial series.
In this tutorial we will learn about error wrapping in Go and why do we even need error wrapping. Let&amp;rsquo;s get started.
What is error wrapping? Error wrapping is the process of encapsulating one error into another. Let&amp;rsquo;s say we have a web server which accesses a database and tries to fetch a record from the DB. If the database call returns an error, we can decide whether to wrap this error or send our own custom error from the webservice.
          
          
        
      </description>
    </item>
    
    <item>
      <title>MySQL Tutorial: Selecting Single and Multiple Rows</title>
      <link>https://golangbot.com/mysql-select-single-multiple-rows/</link>
      <pubDate>Sat, 16 Oct 2021 18:00:04 +0000</pubDate>
      
      <guid>https://golangbot.com/mysql-select-single-multiple-rows/</guid>
      <description>
        
          
            Welcome to tutorial no. 3 in our MySQL tutorial series. In the previous tutorial, we discussed creating a table and inserting rows into the table. In this tutorial, we will learn how to select a single row as well as multiple rows from a table.
MySQL Series Index Connecting to MySQL and creating a Database
Creating a Table and Inserting Rows
Selecting Single Row and Multiple rows
Prepared statements - WIP
          
          
        
      </description>
    </item>
    
    <item>
      <title>MySQL Tutorial: Creating a Table and Inserting Rows</title>
      <link>https://golangbot.com/mysql-create-table-insert-row/</link>
      <pubDate>Sun, 07 Mar 2021 00:58:00 +0000</pubDate>
      
      <guid>https://golangbot.com/mysql-create-table-insert-row/</guid>
      <description>
        
          
            Welcome to tutorial no. 2 in our MySQL tutorial series. In the first tutorial, we discussed how to connect to MySQL and create a database. In this tutorial, we will learn how to create a table and insert records into that table.
MySQL Series Index Connecting to MySQL and creating a Database
Creating a Table and Inserting Rows
Selecting single and multiple rows
Prepared statements - WIP
Updating rows - WIP
          
          
        
      </description>
    </item>
    
    <item>
      <title>MySQL Tutorial: Connecting to MySQL and Creating a DB using Go</title>
      <link>https://golangbot.com/connect-create-db-mysql/</link>
      <pubDate>Tue, 22 Aug 2023 19:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/connect-create-db-mysql/</guid>
      <description>
        
          
            Welcome to tutorial no. 1 in our MySQL tutorial series. In this tutorial, we will connect to MySQL and create a database. We will also ping the DB to ensure that the connection is established properly.
MySQL Series Index Connecting to MySQL and creating a Database
Creating a Table and Inserting Rows
Selecting single and multiple rows
Prepared statements - WIP
Updating rows - WIP
Deleting rows - WIP
Importing the MySQL driver The first step in creating the MySQL database is to download the MySQL driver package and import it into our application.
          
          
        
      </description>
    </item>
    
    <item>
      <title>WebAssembly: DOM Access and Error Handling</title>
      <link>https://golangbot.com/go-webassembly-dom-access/</link>
      <pubDate>Sun, 04 Feb 2024 18:45:00 +0000</pubDate>
      
      <guid>https://golangbot.com/go-webassembly-dom-access/</guid>
      <description>
        
          
            Welcome to tutorial no. 2 of our WebAssembly tutorial series.
Series Index Introduction to WebAssembly Using Go
Accessing DOM from Go using Javascript
In the first tutorial of this tutorial series, we created and exposed a function from Go and called it using JavaScript. I highly recommend reading the first part first part if you have not read it yet.
In this tutorial, we will develop a UI for our application, handle errors and also manipulate the DOM of the browser from Go.
          
          
        
      </description>
    </item>
    
    <item>
      <title>WebAssembly: Introduction to WebAssembly using Go</title>
      <link>https://golangbot.com/webassembly-using-go/</link>
      <pubDate>Sun, 04 Feb 2024 02:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/webassembly-using-go/</guid>
      <description>
        
          
            Welcome to tutorial no. 1 of our WebAssembly tutorial series.
Series Index Introduction to WebAssembly Using Go
DOM Access and Error Handling
What is WebAssembly? JavaScript has been the only programming language that the browser understands. JavaScript has stood the test of time and it has been able to deliver the performance needed by most web applications. But when it comes to 3D games, VR, AR, and image editing apps, JavaScript is not quite up to the mark since it is interpreted.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Debugging Go Applications using Delve</title>
      <link>https://golangbot.com/debugging-go-delve/</link>
      <pubDate>Sun, 13 Aug 2023 11:59:00 +0000</pubDate>
      
      <guid>https://golangbot.com/debugging-go-delve/</guid>
      <description>
        
          
            Need for a debugger The simplest form of debugging in any programming language is by using print statements/logs and writing to standard out. This definitely works but becomes extremely difficult when the size of our application grows and the logic becomes more complex. Adding print statements to every code path of the application is not easy. This is where debuggers come in handy. Debuggers help us to trace the execution path of the program using breakpoints and a host of other features.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Go Packages</title>
      <link>https://golangbot.com/go-packages/</link>
      <pubDate>Mon, 01 Apr 2024 00:11:13 +0000</pubDate>
      
      <guid>https://golangbot.com/go-packages/</guid>
      <description>
        
          
            Welcome to tutorial number 7 in Golang tutorial series.
What are packages and why are they used? So far we have seen Go programs that have only one file with a main function and a couple of other functions. In real-world scenarios, this approach of writing all source code in a single file is not scalable. It becomes impossible to reuse and maintain code written this way. This is where packages are helpful.
          
          
        
      </description>
    </item>
    
    <item>
      <title>DIY Pick and Place Robot</title>
      <link>https://golangbot.com/diy-pick-and-place-robot/</link>
      <pubDate>Sun, 09 Feb 2020 15:47:51 +0000</pubDate>
      
      <guid>https://golangbot.com/diy-pick-and-place-robot/</guid>
      <description>
        
          
            I am working on a DIY Pick and Place Robot course with my friend Balaji. I am taking care of the software side of things while the hardware is taken care by Balaji.
Description A pick and place robotic system automates the process of picking up parts and placing them in a desired location. These robots plays a major role in industrial automation. The system consists of links, joints &amp;amp; gripper equivalent to a human hand.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Hello World</title>
      <link>https://golangbot.com/hello-world-gomod/</link>
      <pubDate>Fri, 29 Mar 2024 08:48:00 +0000</pubDate>
      
      <guid>https://golangbot.com/hello-world-gomod/</guid>
      <description>
        
          
            This is the second tutorial in our Golang tutorial series. Please read our previous tutorial Golang Introduction and Installation to know about what is Golang and how to install Golang.
There is no better way to learn a programming language than getting our hands dirty with code. Let&amp;rsquo;s go ahead and write our first Go program.
Setting up the development environment Let&amp;rsquo;s create a directory where we want to write our hello world program.
          
          
        
      </description>
    </item>
    
    <item>
      <title>June 2019 Quiz Answers and Explanation</title>
      <link>https://golangbot.com/june-2019-quiz-results/</link>
      <pubDate>Fri, 16 Aug 2019 11:54:55 +0000</pubDate>
      
      <guid>https://golangbot.com/june-2019-quiz-results/</guid>
      <description>
        
          
            Here are all the quizzes posted on Twitter and Facebook in June 2019 and their explanation.
Quiz 1 1package main 2 3import ( 4 &amp;#34;fmt&amp;#34; 5) 6 7func hello() []string { 8 return nil 9} 10 11func main() { 12 h := hello 13 if h == nil { 14 fmt.Println(&amp;#34;nil&amp;#34;) 15 } else { 16 fmt.Println(&amp;#34;not nil&amp;#34;) 17 } 18} Run in playground
Options nil not nil compilation error Answer not nil We assign the function hello to the variable h and not the return value of hello() in line no.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Resumable file uploader: Testing the server using curl and dd  commands</title>
      <link>https://golangbot.com/resumable-file-uploader-testing-the-server-using-curl-dd/</link>
      <pubDate>Sat, 19 Jun 2021 00:59:00 +0000</pubDate>
      
      <guid>https://golangbot.com/resumable-file-uploader-testing-the-server-using-curl-dd/</guid>
      <description>
        
          
            Welcome to tutorial no. 4 in our Resumable file uploader series.
In the previous tutorials, we coded our resumable tus server using Go. In this tutorial we will use curl and dd commands to test the tus server.
Testing We have the resumable file upload tus server ready but we have not tested it yet. We need a tus client to test the tus server. We will create the Go client in the upcoming tutorials.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Resumable file uploader: Creating http handlers</title>
      <link>https://golangbot.com/resumable-file-uploader-creating-http-handlers/</link>
      <pubDate>Fri, 18 Jun 2021 00:59:00 +0000</pubDate>
      
      <guid>https://golangbot.com/resumable-file-uploader-creating-http-handlers/</guid>
      <description>
        
          
            Welcome to tutorial no. 3 in our Resumable file uploader series.
The previous tutorials provided an introduction about the tus protocol and we also created the DB CRUD methods.
In this tutorial, we will create the http handlers to support the POST, PATCH and HEAD http methods.
This tutorial has the following sections
POST http handler HEAD http handler PATCH http handler File validation Upload complete validation Upload offset validation Content length validation File patch POST http handler Before we create the POST handler, we need a directory to store the files.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Resumable file uploader: Implementing DB CRUD methods</title>
      <link>https://golangbot.com/resumable-file-uploader-implementing-db-crud-methods/</link>
      <pubDate>Thu, 17 Jun 2021 00:59:00 +0000</pubDate>
      
      <guid>https://golangbot.com/resumable-file-uploader-implementing-db-crud-methods/</guid>
      <description>
        
          
            Welcome to tutorial no. 2 in our Resumable file uploader series.
The last tutorial explained how tus protocol works. I strongly recommend reading the previous tutorial if you are new to tus. In this tutorial, we will create the data model and the database CRUD methods.
This tutorial has the following sections
Data model Table creation Tus Recollection Creating file Updating file Get file Data model Let&amp;rsquo;s first discuss the data model for our tus server.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Resumable file uploader: Understanding tus protocol</title>
      <link>https://golangbot.com/understanding-tus/</link>
      <pubDate>Sat, 19 Jun 2021 00:26:00 +0000</pubDate>
      
      <guid>https://golangbot.com/understanding-tus/</guid>
      <description>
        
          
            Welcome to tutorial no. 1 in our Resumable file uploader series.
How many times have you tried to upload a large file only to know that it failed because of a network issue! When you re-upload the file again, the upload starts from the beginning :(. Not cool at all. This is where resumable file uploaders come in handy.
Resumable file uploaders allow the file upload to start right from the point where it stopped instead of uploading the whole file again.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Writing Files using Go</title>
      <link>https://golangbot.com/write-files/</link>
      <pubDate>Sun, 13 Aug 2023 14:52:00 +0000</pubDate>
      
      <guid>https://golangbot.com/write-files/</guid>
      <description>
        
          
            Welcome to tutorial no. 37 in Golang tutorial series.
In this tutorial, we will learn how to write data to files using Go. We will also learn how to write to a file concurrently.
This tutorial has the following sections
Writing string to a file Writing bytes to a file Writing data to a file line by line Appending to a file Writing to a file concurrently Please run all the programs of this tutorial in your local system as playground doesn&amp;rsquo;t support file operations.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Reading Files</title>
      <link>https://golangbot.com/read-files/</link>
      <pubDate>Sun, 31 Jul 2022 08:54:00 +0000</pubDate>
      
      <guid>https://golangbot.com/read-files/</guid>
      <description>
        
          
            Welcome to tutorial no. 36 in Golang tutorial series.
File reading is one of the most common operations performed in any programming language. In this tutorial, we will learn about how files can be read using Go.
This tutorial has the following sections.
Reading an entire file into memory Using an absolute file path Passing the file path as a command line flag Bundling the file inside the binary Reading a file in small chunks Reading a file line by line Reading an entire file into memory One of the most basic file operations is reading an entire file into memory.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Reflection in Go</title>
      <link>https://golangbot.com/reflection/</link>
      <pubDate>Thu, 20 May 2021 10:06:00 +0000</pubDate>
      
      <guid>https://golangbot.com/reflection/</guid>
      <description>
        
          
            Welcome to tutorial no. 35 in Golang tutorial series.
Reflection is one of the advanced topics in Go. I will try to make it as simple as possible.
This tutorial has the following sections.
What is reflection? What is the need to inspect a variable and find its type? reflect package reflect.Type and reflect.Value reflect.Kind NumField() and Field() methods Int() and String() methods Complete program Should reflection be used? Let&amp;rsquo;s discuss these sections one by one now.
          
          
        
      </description>
    </item>
    
    <item>
      <title>First Class Functions</title>
      <link>https://golangbot.com/first-class-functions/</link>
      <pubDate>Thu, 13 May 2021 00:06:00 +0000</pubDate>
      
      <guid>https://golangbot.com/first-class-functions/</guid>
      <description>
        
          
            Welcome to tutorial no. 34 in Golang tutorial series.
What are first class functions? A language that supports first class functions allows functions to be assigned to variables, passed as arguments to other functions and returned from other functions. Go has support for first class functions.
In this tutorial, we will discuss the syntax and various use cases of first class functions.
Anonymous functions Let&amp;rsquo;s start with a simple example which assigns a function to a variable.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Panic and Recover</title>
      <link>https://golangbot.com/panic-and-recover/</link>
      <pubDate>Wed, 24 Sep 2025 19:40:00 +0000</pubDate>
      
      <guid>https://golangbot.com/panic-and-recover/</guid>
      <description>
        
          
            Welcome to tutorial no. 33 in Golang tutorial series.
What is Panic? The idiomatic way of handling abnormal conditions in a Go program is using errors. Errors are sufficient for most of the abnormal conditions arising in the program.
But there are some situations where the program cannot continue execution after an abnormal condition. In this case, we use panic to prematurely terminate the program. When a function encounters a panic, its execution is stopped, any deferred functions are executed and then the control returns to its caller.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Custom Errors</title>
      <link>https://golangbot.com/custom-errors/</link>
      <pubDate>Mon, 29 Aug 2022 18:59:00 +0000</pubDate>
      
      <guid>https://golangbot.com/custom-errors/</guid>
      <description>
        
          
            Welcome to tutorial no. 31 in our Golang tutorial series.
In the last tutorial we learnt about error representation in Go and how to handle errors from the standard library. We also learnt how to extract more information from the errors.
This tutorial deals with how to create our own custom errors which we can use in our functions and packages. We will also use the same techniques employed by the standard library to provide more details about our custom errors.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Error Handling</title>
      <link>https://golangbot.com/error-handling/</link>
      <pubDate>Sat, 20 Aug 2022 20:15:00 +0000</pubDate>
      
      <guid>https://golangbot.com/error-handling/</guid>
      <description>
        
          
            Welcome to tutorial no. 30 in Golang tutorial series.
What are errors? Errors indicate any abnormal condition occurring in the program. Let&amp;rsquo;s say we are trying to open a file and the file does not exist in the file system. This is an abnormal condition and it&amp;rsquo;s represented as an error.
Errors in Go are plain old values. Just like any other built-in type such as int, float64, &amp;hellip; error values can be stored in variables, passed as parameters to functions, returned from functions, and so on.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Defer</title>
      <link>https://golangbot.com/defer/</link>
      <pubDate>Thu, 06 Jun 2024 00:52:00 +0000</pubDate>
      
      <guid>https://golangbot.com/defer/</guid>
      <description>
        
          
            Welcome to tutorial no. 29 in Golang tutorial series.
What is Defer? Defer statement is used to execute a function call just before the surrounding function where the defer statement is present returns. The definition might seem complex but it&amp;rsquo;s pretty simple to understand by means of an example.
Example 1package main 2 3import ( 4	&amp;#34;fmt&amp;#34; 5	&amp;#34;time&amp;#34; 6) 7 8func totalTime(start time.Time) { 9	fmt.Printf(&amp;#34;Total time taken %f seconds&amp;#34;, time.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Polymorphism - OOP in Go</title>
      <link>https://golangbot.com/polymorphism/</link>
      <pubDate>Mon, 29 Mar 2021 00:09:00 +0000</pubDate>
      
      <guid>https://golangbot.com/polymorphism/</guid>
      <description>
        
          
            Welcome to tutorial no. 28 in Golang tutorial series.
Polymorphism in Go is achieved with the help of interfaces. As we have already discussed, interfaces are implicitly implemented in Go. A type implements an interface if it provides definitions for all the methods declared in the interface. Let&amp;rsquo;s see how polymorphism is achieved in Go with the help of interfaces.
Polymorphism using an interface Any type which provides definition for all the methods of an interface is said to implicitly implement that interface.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Composition Instead of Inheritance - OOP in Go</title>
      <link>https://golangbot.com/inheritance/</link>
      <pubDate>Tue, 23 Mar 2021 00:48:00 +0000</pubDate>
      
      <guid>https://golangbot.com/inheritance/</guid>
      <description>
        
          
            Welcome to tutorial no. 27 in Golang tutorial series.
Go does not support inheritance, however, it does support composition. The generic definition of composition is &amp;ldquo;put together&amp;rdquo;. One example of composition is a car. A car is composed of wheels, an engine and various other parts.
Composition by embedding structs Composition can be achieved in Go is by embedding one struct type into another.
A blog post is a perfect example of composition.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Structs Instead of Classes - OOP in Go</title>
      <link>https://golangbot.com/structs-instead-of-classes/</link>
      <pubDate>Sun, 03 May 2020 11:07:00 +0000</pubDate>
      
      <guid>https://golangbot.com/structs-instead-of-classes/</guid>
      <description>
        
          
            Welcome to tutorial no. 26 in Golang tutorial series.
Is Go Object Oriented? Go is not a pure object oriented programming language. This excerpt taken from Go&amp;rsquo;s FAQs answers the question of whether Go is Object Oriented.
Yes and no. Although Go has types and methods and allows an object-oriented style of programming, there is no type hierarchy. The concept of “interface” in Go provides a different approach that we believe is easy to use and in some ways more general.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Go Mutex Tutorial</title>
      <link>https://golangbot.com/mutex/</link>
      <pubDate>Wed, 03 Mar 2021 12:41:00 +0000</pubDate>
      
      <guid>https://golangbot.com/mutex/</guid>
      <description>
        
          
            Welcome to tutorial no. 25 in Golang tutorial series.
In this tutorial, we will learn about mutexes. We will also learn how to solve race conditions using mutexes and channels.
Critical section Before jumping to mutex, it is important to understand the concept of critical section in concurrent programming. When a program runs concurrently, the parts of code which modify shared resources should not be accessed by multiple Goroutines at the same time.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Select</title>
      <link>https://golangbot.com/select/</link>
      <pubDate>Wed, 03 Mar 2021 10:54:00 +0000</pubDate>
      
      <guid>https://golangbot.com/select/</guid>
      <description>
        
          
            Welcome to tutorial no. 24 in Golang tutorial series.
What is select? The select statement is used to choose from multiple send/receive channel operations. The select statement blocks until one of the send/receive operations is ready. If multiple operations are ready, one of them is chosen at random. The syntax is similar to switch except that each of the case statements will be a channel operation. Let&amp;rsquo;s dive right into some code for better understanding.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Buffered Channels and Worker Pools</title>
      <link>https://golangbot.com/buffered-channels-worker-pools/</link>
      <pubDate>Fri, 15 Oct 2021 01:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/buffered-channels-worker-pools/</guid>
      <description>
        
          
            Welcome to tutorial no. 23 in Golang tutorial series.
What are buffered channels? All the channels we discussed in the previous tutorial were basically unbuffered. As we discussed in the channels tutorial in detail, sends and receives to an unbuffered channel are blocking.
It is possible to create a channel with a buffer. Sends to a buffered channel are blocked only when the buffer is full. Similarly receives from a buffered channel are blocked only when the buffer is empty.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Channels</title>
      <link>https://golangbot.com/channels/</link>
      <pubDate>Fri, 15 Oct 2021 00:41:00 +0000</pubDate>
      
      <guid>https://golangbot.com/channels/</guid>
      <description>
        
          
            Welcome to tutorial no. 22 in Golang tutorial series.
In the previous tutorial, we discussed about how concurrency is achieved in Go using Goroutines. In this tutorial we will discuss about channels and how Goroutines communicate using channels.
What are channels Channels can be thought of as pipes using which Goroutines communicate. Similar to how water flows from one end to another in a pipe, data can be sent from one end and received from the other end using channels.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Goroutines</title>
      <link>https://golangbot.com/goroutines/</link>
      <pubDate>Sat, 19 Jun 2021 00:57:00 +0000</pubDate>
      
      <guid>https://golangbot.com/goroutines/</guid>
      <description>
        
          
            Welcome to tutorial no. 21 in Golang tutorial series.
In the previous tutorial, we discussed concurrency and how it is different from parallelism. In this tutorial, we will discuss how concurrency is achieved in Go using Goroutines.
What are Goroutines? Goroutines are functions or methods that run concurrently with other functions or methods. Goroutines can be thought of as lightweight threads. The cost of creating a Goroutine is tiny when compared to a thread.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Introduction to Concurrency</title>
      <link>https://golangbot.com/concurrency/</link>
      <pubDate>Wed, 03 Mar 2021 19:32:00 +0000</pubDate>
      
      <guid>https://golangbot.com/concurrency/</guid>
      <description>
        
          
            Welcome to tutorial no. 20 in Golang tutorial series.
Go is a concurrent language and not a parallel one. Before discussing how concurrency is taken care in Go, we must first understand what is concurrency and how it is different from parallelism.
What is concurrency? Concurrency is the capability to deal with lots of things at once. It&amp;rsquo;s best explained with an example.
Let&amp;rsquo;s consider a person jogging. During his morning jog, let&amp;rsquo;s say his shoelaces become untied.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Interfaces - Part II</title>
      <link>https://golangbot.com/interfaces-part-2/</link>
      <pubDate>Tue, 28 Jan 2025 05:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/interfaces-part-2/</guid>
      <description>
        
          
            Welcome to tutorial no. 19 in Golang tutorial series. This is the second part in our 2 part interface tutorial. In case you missed the first part, you can read it here interfaces-part-1.
Implementing interfaces using pointer receivers vs value receivers All the interfaces we discussed in part 1 were implemented using value receivers. It is also possible to implement interfaces using pointer receivers. There is a subtlety to be noted while implementing interfaces using pointer receivers.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Interfaces - Part I</title>
      <link>https://golangbot.com/interfaces-part-1/</link>
      <pubDate>Mon, 27 Jan 2025 00:06:00 +0000</pubDate>
      
      <guid>https://golangbot.com/interfaces-part-1/</guid>
      <description>
        
          
            Welcome to tutorial no. 18 in Golang tutorial series. This is the first part in our 2 part interface tutorial.
What is an interface? In Go, an interface is a set of method signatures. When a type provides definition for all the methods in the interface, it is said to implement the interface. Interface specifies what methods a type should have and the type decides how to implement these methods.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Methods in Go</title>
      <link>https://golangbot.com/methods/</link>
      <pubDate>Sat, 19 Jun 2021 00:40:00 +0000</pubDate>
      
      <guid>https://golangbot.com/methods/</guid>
      <description>
        
          
            Welcome to tutorial no. 17 in Golang tutorial series.
Introduction A method is just a function with a special receiver type between the func keyword and the method name. The receiver can either be a struct type or non-struct type.
The syntax of a method declaration is provided below.
func (t Type) methodName(parameter list) { } The above snippet creates a method named methodName with receiver type Type. t is called as the receiver and it can be accessed within the method.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Structs</title>
      <link>https://golangbot.com/structs/</link>
      <pubDate>Mon, 08 Sep 2025 00:00:01 +0000</pubDate>
      
      <guid>https://golangbot.com/structs/</guid>
      <description>
        
          
            Welcome to tutorial no. 16 in our Golang tutorial series.
What is a struct? A struct is a user-defined type that represents a collection of fields. It can be used in places where it makes sense to group the data into a single unit rather than having each of them as separate variables.
For instance, an employee has a firstName, lastName and age. It makes sense to group these three properties into a single struct named Employee.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Pointers</title>
      <link>https://golangbot.com/pointers/</link>
      <pubDate>Sat, 19 Jun 2021 00:18:00 +0000</pubDate>
      
      <guid>https://golangbot.com/pointers/</guid>
      <description>
        
          
            Welcome to tutorial no. 15 in Golang tutorial series.
In this tutorial, we will learn how pointers work in Go and we will also understand how Go pointers differ from pointers in other languages such as C and C++.
This tutorial has the following sections.
What is a pointer? Declaring pointers Zero value of a pointer Creating pointers using the new function Dereferencing a pointer Passing pointer to a function Returning pointer from a function Do not pass a pointer to an array as an argument to a function.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Strings</title>
      <link>https://golangbot.com/strings/</link>
      <pubDate>Sun, 17 Aug 2025 07:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/strings/</guid>
      <description>
        
          
            Welcome to tutorial no. 14 in Golang tutorial series.
Strings deserve a special mention in Go as they are different in implementation when compared to other languages.
What is a String? A string is a slice of bytes in Go. Strings can be created by enclosing a set of characters inside double quotes &amp;quot; &amp;quot;.
Let&amp;rsquo;s look at a simple example that creates a string and prints it.
1package main 2 3import ( 4	&amp;#34;fmt&amp;#34; 5) 6 7func main() { 8	name := &amp;#34;Hello World&amp;#34; 9	fmt.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Golang Maps Tutorial</title>
      <link>https://golangbot.com/maps/</link>
      <pubDate>Mon, 10 Jun 2024 08:55:00 +0000</pubDate>
      
      <guid>https://golangbot.com/maps/</guid>
      <description>
        
          
            Welcome to tutorial no. 13 in Golang tutorial series.
What is a map? A map is a inbuilt data type in Go which is used to store key-value pairs. A practical use case for a map is for storing the currency codes and the corresponding currency names.
USD - United States Dollar EUR - Euro INR - India Rupee A map will be a perfect fit for the above use case use case.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Variadic Functions</title>
      <link>https://golangbot.com/variadic-functions/</link>
      <pubDate>Sun, 22 Jun 2025 00:10:00 +0000</pubDate>
      
      <guid>https://golangbot.com/variadic-functions/</guid>
      <description>
        
          
            Welcome to part 12 of our Golang tutorial series.
What is a variadic function? Functions in general accept only a fixed number of arguments. A variadic function is a function that accepts a variable number of arguments. If the last parameter of a function definition is prefixed by ellipsis &amp;hellip;, then the function can accept any number of arguments for the last parameter.
Only the last parameter of a function can be variadic.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Arrays and Slices</title>
      <link>https://golangbot.com/arrays-and-slices/</link>
      <pubDate>Sun, 08 Jun 2025 00:52:00 +0000</pubDate>
      
      <guid>https://golangbot.com/arrays-and-slices/</guid>
      <description>
        
          
            Welcome to the part 11 of Golang tutorial series. In this tutorial, we will learn about Arrays and Slices in Go.
What is an Array? An array is a collection of elements. For example, the collection of integers 5, 8, 9, 79, 76 constitute an array.
Declaration An array belongs to the type [n]T. n represents the number of elements in an array and T represents the type of each element.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Switch  Statement</title>
      <link>https://golangbot.com/switch/</link>
      <pubDate>Sat, 26 Oct 2024 00:35:00 +0000</pubDate>
      
      <guid>https://golangbot.com/switch/</guid>
      <description>
        
          
            This is tutorial number 10 in Golang tutorial series.
What is a switch statement? A switch is a conditional statement that evaluates an expression and compares it against a list of possible matches and executes the corresponding block of code. It can be considered as an idiomatic way of replacing complex if else clauses.
Example An example program is worth a hundred words. Let&amp;rsquo;s start with a simple example which will take a finger number as input and outputs the name of that finger :) .
          
          
        
      </description>
    </item>
    
    <item>
      <title>Loops</title>
      <link>https://golangbot.com/loops/</link>
      <pubDate>Sun, 20 Oct 2024 00:18:00 +0000</pubDate>
      
      <guid>https://golangbot.com/loops/</guid>
      <description>
        
          
            Welcome to tutorial number 9 in Golang tutorial series.
A loop is used to execute a block of code repeatedly until a condition is satisfied.
for is the only loop available in Go. Go doesn&amp;rsquo;t have while or do while loops which are present in other languages like C.
for loop syntax for initialisation; condition; post { } The initialisation statement will be executed only once. After the loop is initialised, the condition is checked.
          
          
        
      </description>
    </item>
    
    <item>
      <title>If else statement</title>
      <link>https://golangbot.com/if-statement/</link>
      <pubDate>Sun, 26 May 2024 14:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/if-statement/</guid>
      <description>
        
          
            Welcome to tutorial number 8 of our Golang tutorial series.
if statement has a condition and it executes a block of code if that condition evaluates to true. It executes an alternate else block if the condition evaluates to false. In this tutorial we will look at the various syntaxes for using a if statement.
If statement syntax The syntax of the if statement is provided below
if condition { } If the condition evaluates to true, the block of code between the braces { and } is executed.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Packages in Go</title>
      <link>https://golangbot.com/packages/</link>
      <pubDate>Tue, 04 Apr 2017 17:57:34 +0000</pubDate>
      
      <guid>https://golangbot.com/packages/</guid>
      <description>
        
          
            This tutorial is now deprecated. Please click here for the updated version.
Welcome to tutorial number 7 in Golang tutorial series.
What are packages and why are they used? So far we have seen go programs which have only one file which has a main function with a couple of other functions. In real world scenarios this approach to writing all source code in a single file will not work. It becomes impossible to reuse and maintain code written this way.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Functions</title>
      <link>https://golangbot.com/functions/</link>
      <pubDate>Wed, 09 Oct 2024 16:00:00 +0000</pubDate>
      
      <guid>https://golangbot.com/functions/</guid>
      <description>
        
          
            Welcome to tutorial no. 6 in our Golang tutorial series.
What is a function? A function is a block of code that performs a specific task. A function takes an input, performs some operations on the input and generates outputs. For example, a function can take the radius as input and calculate the area and circumference as output.
Function declaration The following is the syntax for declaring a function in Go
          
          
        
      </description>
    </item>
    
    <item>
      <title>Constants</title>
      <link>https://golangbot.com/constants/</link>
      <pubDate>Mon, 06 May 2024 08:30:00 +0000</pubDate>
      
      <guid>https://golangbot.com/constants/</guid>
      <description>
        
          
            Welcome to tutorial no. 5 in our Golang tutorial series.
What is a constant? Constants in Go is used to denote fixed static values such as
95 &amp;#34;I love Go&amp;#34; 67.89 and so on. Constants are generally used to represent values that do not change throughout the life time of an application.
Declaring a constant The keyword const is used to declare a constant in Go. Let&amp;rsquo;s see how to declare a constant by means an example.
          
          
        
      </description>
    </item>
    
    <item>
      <title> Data Types</title>
      <link>https://golangbot.com/types/</link>
      <pubDate>Sun, 05 May 2024 01:54:00 +0000</pubDate>
      
      <guid>https://golangbot.com/types/</guid>
      <description>
        
          
            Welcome to tutorial number 4 in our Golang tutorial series.
Please read Golang tutorial part 3: Variables of this series to learn about variables.
The following are the basic data types available in Go
bool Numeric Types int8, int16, int32, int64, int uint8, uint16, uint32, uint64, uint float32, float64 complex64, complex128 byte rune string bool bool type represents a boolean. It can either be a true or false value.
1package main 2 3import &amp;#34;fmt&amp;#34; 4 5func main() { 6	a := true 7	b := false 8	fmt.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Variables</title>
      <link>https://golangbot.com/variables/</link>
      <pubDate>Mon, 01 Apr 2024 04:52:00 +0000</pubDate>
      
      <guid>https://golangbot.com/variables/</guid>
      <description>
        
          
            This is the third tutorial in our Golang tutorial series and it deals with variables in Golang.
You can read part 2 to learn about configuring Go and running the hello world program.
What is a variable? Variable is the name given to a memory location to store a value of a specific type. There are various syntaxes to declare variables in Go. Let&amp;rsquo;s look at them one by one.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Hello World</title>
      <link>https://golangbot.com/hello-world/</link>
      <pubDate>Sat, 04 Feb 2017 14:19:00 +0000</pubDate>
      
      <guid>https://golangbot.com/hello-world/</guid>
      <description>
        
          
            This tutorial is now deprecated. Please visit /hello-world-gomod/ for the updated version.
This is the second tutorial in our Golang tutorial series. Please read Golang tutorial part 1: Introduction and installation to know about what is golang and how to install golang.
There is no better way to learn a programming language than getting our hands dirty with code. Lets go ahead and write our first go program.
I would personally recommend using Visual Studio Code with the go extension as the IDE.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Introduction and Installation</title>
      <link>https://golangbot.com/golang-tutorial-part-1-introduction-and-installation/</link>
      <pubDate>Sun, 13 Aug 2023 04:19:00 +0000</pubDate>
      
      <guid>https://golangbot.com/golang-tutorial-part-1-introduction-and-installation/</guid>
      <description>
        
          
            This is the first tutorial in our Golang tutorial series. This tutorial provides an introduction to Go and also discusses the advantages of choosing Go over other programming languages. We will also learn how to install Go in Mac OS, Windows and Linux.
Introduction Go also known as Golang is an open source, compiled and statically typed programming language developed by Google. The key people behind the creation of Go are Rob Pike, Ken Thompson and Robert Griesemer.
          
          
        
      </description>
    </item>
    
  </channel>
</rss>
