<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vaibhav Thukral</title>
    <description>The latest articles on DEV Community by Vaibhav Thukral (@vaibhavt14).</description>
    <link>https://dev.to/vaibhavt14</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1810997%2Ff5701908-bdd1-4648-83a6-5252d099ed61.PNG</url>
      <title>DEV Community: Vaibhav Thukral</title>
      <link>https://dev.to/vaibhavt14</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vaibhavt14"/>
    <language>en</language>
    <item>
      <title>Learn these 13 Git commands because you'll be using them 99% of the time:</title>
      <dc:creator>Vaibhav Thukral</dc:creator>
      <pubDate>Sun, 18 Aug 2024 10:57:40 +0000</pubDate>
      <link>https://dev.to/vaibhavt14/learn-these-13-git-commands-because-youll-be-using-them-99-of-the-time-l77</link>
      <guid>https://dev.to/vaibhavt14/learn-these-13-git-commands-because-youll-be-using-them-99-of-the-time-l77</guid>
      <description>&lt;p&gt;1) &lt;code&gt;git init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Initialize a new Git repository.&lt;/p&gt;

&lt;p&gt;This creates a new subdirectory named ".git" in the current directory, where Git stores all the metadata for the repository.&lt;/p&gt;

&lt;p&gt;2) &lt;code&gt;git clone&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Clone an existing repository.&lt;/p&gt;

&lt;p&gt;This creates a local copy of the repository, including all of its history and branches.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git clone &amp;lt;repo-link&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3) &lt;code&gt;git add&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Stage changes for the next commit.&lt;/p&gt;

&lt;p&gt;This adds the specified file(s) to the staging area, where they will be included in the next commit.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add file1.txt file2.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;4) &lt;code&gt;git commit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Create a new commit.&lt;/p&gt;

&lt;p&gt;This records the staged changes and any additional changes made since the last commit, along with a commit message describing the changes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m "Add new feature"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;5) &lt;code&gt;git push&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Push commits to a remote repository.&lt;/p&gt;

&lt;p&gt;This sends the local commits to the specified remote repository, updating the branch on the remote with the new commits.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push origin main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;6) &lt;code&gt;git pull&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Fetch and merge changes from a remote repository.&lt;/p&gt;

&lt;p&gt;This retrieves the latest commits from the specified remote repository and merges them into the current branch.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git pull origin main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;7) &lt;code&gt;git branch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;List, create, or delete branches.&lt;/p&gt;

&lt;p&gt;This command can be used to list the available branches in a repository, create a new branch, or delete an existing branch.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git branch new-branch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;8) &lt;code&gt;git checkout&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Switch to a different branch.&lt;/p&gt;

&lt;p&gt;This command allows you to switch to a different branch in the repository and make it the current working branch.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git checkout main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;9) &lt;code&gt;git merge&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Merge one branch into another.&lt;/p&gt;

&lt;p&gt;This command combines the changes from one branch into another branch, creating a new commit that reflects the merged changes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git merge new-branch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;10) &lt;code&gt;git status&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Show the status of the repository.&lt;/p&gt;

&lt;p&gt;This command displays the current branch, any staged or unstaged changes, and any untracked files.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;11) &lt;code&gt;git rebase&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Incorporate changes from one branch into another branch.&lt;/p&gt;

&lt;p&gt;Let's say you have made some changes on an "XYZ" branch that you want to incorporate into the "main" branch. You can use git rebase to reapply your changes on top of the main branch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqaffkox4qky9vk2w0qfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqaffkox4qky9vk2w0qfl.png" alt="Image description" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;12) &lt;code&gt;git stash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Temporarily save changes that you are not yet ready to commit.&lt;/p&gt;

&lt;p&gt;If your changes are not ready to commit but you want to work on a different branch, you can temporarily save your changes for later use and switch branches without losing your progress.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xwpxniawbuvn36l9ux1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xwpxniawbuvn36l9ux1.png" alt="Image description" width="800" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;13) &lt;code&gt;git revert&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let's say you have made a mistake in a previous commit and you need to undo it. You can use git revert to create a new commit that undoes the changes introduced by the previous commit.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git revert &amp;lt;commit1&amp;gt;..&amp;lt;commit2&amp;gt;&lt;/code&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>Lambda functions in Python clearly explained!!</title>
      <dc:creator>Vaibhav Thukral</dc:creator>
      <pubDate>Thu, 08 Aug 2024 05:30:17 +0000</pubDate>
      <link>https://dev.to/vaibhavt14/lambda-functions-in-python-clearly-explained-a3b</link>
      <guid>https://dev.to/vaibhavt14/lambda-functions-in-python-clearly-explained-a3b</guid>
      <description>&lt;p&gt;In this post we will explore Lambda functions in Python:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What exactly is lambda functions?&lt;/li&gt;
&lt;li&gt;Why Do We Need Lambda Functions?&lt;/li&gt;
&lt;li&gt;When to Use Lambda Functions?&lt;/li&gt;
&lt;li&gt;Best Practices&lt;/li&gt;
&lt;li&gt;Examples&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What exactly is lambda functions?
&lt;/h3&gt;

&lt;p&gt;In Python, a lambda function is a small, anonymous function that can take any number of arguments, but can only have one expression. It's a shorthand way to create a function without declaring it with the &lt;strong&gt;def&lt;/strong&gt; keyword.&lt;/p&gt;

&lt;p&gt;Still confused?&lt;/p&gt;

&lt;p&gt;Let's understand in laymen's terms&lt;/p&gt;

&lt;p&gt;A lambda function is a small, shortcut way to create a simple function. Think of it like a recipe:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Normal Function (Recipe)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write down a list of steps (function name, ingredients, instructions)&lt;/li&gt;
&lt;li&gt;Follow the steps to make the dish (call the function)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Lambda Function (Quick Recipe)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write down just the essential steps (ingredients, instructions)&lt;/li&gt;
&lt;li&gt;Use it to make the dish quickly (call the lambda function)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In programming, a lambda function is a concise way to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Take some input (ingredients)&lt;/li&gt;
&lt;li&gt;Do a simple task (instructions)&lt;/li&gt;
&lt;li&gt;Return the result (dish)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's like a quick, disposable recipe that you can use once or multiple times, without having to write down the full recipe book!&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax of Lambda Function
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5fave30gvmhjomkibwk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5fave30gvmhjomkibwk.png" alt="Image description" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Where arguments is a comma-separated list of variables that will be passed to the function, and expression is the code that will be executed when the function is called.&lt;/p&gt;

&lt;p&gt;Let's create a lambda function that takes one argument, x, and returns its square:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqfyqr05k56qtn8pf4svb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqfyqr05k56qtn8pf4svb.png" alt="Image description" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, x is the argument, and x ** 2 is the expression that will be executed when the function is called. We can call this function like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print(square(5))&lt;/code&gt;  # Output: 25&lt;/p&gt;

&lt;p&gt;Example: &lt;strong&gt;Lambda Function with Multiple Arguments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's create a lambda function that takes two arguments, x and y, and returns their sum:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pdy5vtnyaexddiuw5sv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pdy5vtnyaexddiuw5sv.png" alt="Image description" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, x and y are the arguments, and x + y is the expression that will be executed when the function is called. We can call this function like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print(add(3, 4))&lt;/code&gt;  # Output: 7&lt;/p&gt;

&lt;p&gt;Lambda functions are often used with the &lt;strong&gt;map()&lt;/strong&gt;, &lt;strong&gt;filter()&lt;/strong&gt;, and &lt;strong&gt;reduce()&lt;/strong&gt; functions to perform operations on lists and other iterables.&lt;/p&gt;

&lt;p&gt;Example: &lt;strong&gt;Using Lambda with Map&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's use a lambda function with map() to square all numbers in a list:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fegouy3dc3fwxp86y53qx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fegouy3dc3fwxp86y53qx.png" alt="Image description" width="800" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, the lambda function lambda x: x ** 2 is applied to each element in the numbers list using map().&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Do We Need Lambda Functions?
&lt;/h3&gt;

&lt;p&gt;Lambda functions are useful when we need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create small, one-time use functions&lt;/li&gt;
&lt;li&gt;Simplify code and reduce verbosity&lt;/li&gt;
&lt;li&gt;Use functions as arguments to higher-order functions (like map(), filter(), and reduce())&lt;/li&gt;
&lt;li&gt;Create anonymous functions (functions without a declared name)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When to Use Lambda Functions
&lt;/h3&gt;

&lt;p&gt;Use lambda functions when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need a quick, one-time use function that doesn't warrant a full function declaration&lt;/li&gt;
&lt;li&gt;You want to simplify code and reduce verbosity&lt;/li&gt;
&lt;li&gt;You need to pass a function as an argument to another function (like map(), filter(), and reduce())&lt;/li&gt;
&lt;li&gt;You want to create an anonymous function&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example Scenarios
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data processing: Use lambda functions to perform simple data transformations or filtering&lt;/li&gt;
&lt;li&gt;Event handling: Use lambda functions as event handlers for GUI applications or web frameworks&lt;/li&gt;
&lt;li&gt;Functional programming: Use lambda functions to create higher-order functions and functional pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Best Practices
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Keep lambda functions short and simple&lt;/li&gt;
&lt;li&gt;Use lambda functions for one-time use cases&lt;/li&gt;
&lt;li&gt;Avoid using lambda functions for complex logic or multiple statements&lt;/li&gt;
&lt;li&gt;Use named functions for complex logic or reusable code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By understanding lambda functions and their use cases, you can write more concise, readable, and efficient Python code.&lt;/p&gt;

</description>
      <category>learning</category>
      <category>python</category>
      <category>beginners</category>
      <category>coding</category>
    </item>
    <item>
      <title>What Exactly Concurrency in Go?: Running Tasks in Parallel</title>
      <dc:creator>Vaibhav Thukral</dc:creator>
      <pubDate>Sat, 03 Aug 2024 12:05:02 +0000</pubDate>
      <link>https://dev.to/vaibhavt14/what-exactly-concurrency-in-go-running-tasks-in-parallel-j4p</link>
      <guid>https://dev.to/vaibhavt14/what-exactly-concurrency-in-go-running-tasks-in-parallel-j4p</guid>
      <description>&lt;p&gt;In this post we will explore about concurrency in Go:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understanding Goroutines&lt;/li&gt;
&lt;li&gt;Sending data to Channels&lt;/li&gt;
&lt;li&gt;Controlling Code Flow and Simultaneous Tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Understanding Concurrency &amp;amp; Goroutines
&lt;/h2&gt;

&lt;h4&gt;
  
  
  What is concurrency in Go and what are these Goroutines?
&lt;/h4&gt;

&lt;p&gt;Before understanding concurrency and Goroutines first understand how go program normally executes when we are not using any concurrency features because in a normal program if we have bunch of function calls that do stuff these functions are simply executes after each other in a below image&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5o5l29vmtiozncooyhqi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5o5l29vmtiozncooyhqi.png" alt="Image description" width="800" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From this above image it will call from left to right in a sequence until all each function return something and most important thing is second function only start after the first function is finished and so on..&lt;/p&gt;

&lt;p&gt;In Go you can run code in parallel and execute function concurrently by using a feature called &lt;strong&gt;Goroutines.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3m6zfqnw4l1eaov15r3d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3m6zfqnw4l1eaov15r3d.png" alt="Image description" width="800" height="204"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func main(){
greet("Nice to meet you!")
greet("How are you")
slowGreet("How...are...you?")
greet("I hope you're liking this content")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This above code will work in a sequence the function will call one by one when after completing the each function execution&lt;/p&gt;

&lt;p&gt;Assume slowGreet() functions take more than 2 mins to complete the execution of function after that last greet() function will execute.&lt;/p&gt;

&lt;p&gt;Now to make it more faster we can use feature called &lt;strong&gt;Goroutines&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To run this above code parallel by adding the &lt;strong&gt;go&lt;/strong&gt; keyword&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func main(){
go greet("Nice to meet you!")
go greet("How are you")
go slowGreet("How...are...you?")
go greet("I hope you're liking this content")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By adding this built-in go keyword you tell go that you wanna run these functions as go routines which in end simply means they still will be execute but they now run in parallel instead of after each other.&lt;/p&gt;

&lt;p&gt;We just added the go keyword here nothing else.&lt;/p&gt;

&lt;p&gt;When you run this code it finishes instantly but you also see we don't get any output here in the console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0rw2zpwh5h2cies8uxt8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0rw2zpwh5h2cies8uxt8.png" alt="Image description" width="800" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why this happens?
&lt;/h3&gt;

&lt;p&gt;To understand this it's important to understand and keep in mind the idea behind running function as goroutine is to run it in a non blocking way so that the next operation their after next function call their after and so on.. can immediately be invoked so if we run all four functions as goroutines as we doing it above then we essentially just dispatch these four goroutines task in above code then we are done in the main function. &lt;/p&gt;

&lt;p&gt;And it also doesn't return a value and that's a place where a function called doesn't wait for the goroutine to complete that's the idea it's just dispatch and then it goes it's own.&lt;/p&gt;

&lt;p&gt;Now you might think that these greet functions are so simple that they should immediately print something to the console but dispatching these four goroutines starting these four goroutines is faster that's why its program ends without output.&lt;/p&gt;

&lt;p&gt;So what's the solution?&lt;/p&gt;

&lt;p&gt;The solution for this problem is called &lt;strong&gt;channels&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Channels are typed conduits that allow goroutines to exchange data. They're like pipes that connect goroutines, enabling them to send and receive values.&lt;/p&gt;

&lt;p&gt;Typed: Channels are declared with a specific type, which determines the type of data that can be sent and received through the channel.&lt;/p&gt;

&lt;p&gt;Conduits: Channels act as a pipeline or a communication channel between goroutines, allowing them to exchange data.&lt;/p&gt;

&lt;p&gt;Think of a channel like a pipe that can only carry a specific type of fluid (data). Just as a water pipe can't carry oil, a channel declared with a specific type can only carry data of that type.&lt;/p&gt;

&lt;h3&gt;
  
  
  Declaring Channels
&lt;/h3&gt;

&lt;p&gt;Channels are declared using the &lt;strong&gt;chan&lt;/strong&gt; keyword followed by the type of data they'll carry:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ch := make(chan int) // declares a channel of integers&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Sending and Receiving
&lt;/h3&gt;

&lt;p&gt;Goroutines can send and receive values on channels using the &lt;strong&gt;&amp;lt;-&lt;/strong&gt; operator:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ch &amp;lt;- 42 // send 42 on the channel&lt;br&gt;
x := &amp;lt;-ch // receive a value from the channel&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Channel Types
&lt;/h3&gt;

&lt;p&gt;There are two types of channels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unbuffered Channels&lt;/strong&gt;: No capacity, sending and receiving blocks until the other side is ready.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Buffered Channels:&lt;/strong&gt; Has a capacity, sending and receiving doesn't block until the buffer is full or empty.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Buffered Channels&lt;br&gt;
Buffered channels are declared with a capacity:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ch := make(chan int, 10) // declares a buffered channel of integers with capacity 10&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Range and Select&lt;br&gt;
Channels can be used with the range keyword to iterate over received values:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;for x := range ch { // iterates over received values&lt;br&gt;
    fmt.Println(x)&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Best Practices
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use channels to communicate between goroutines.&lt;/li&gt;
&lt;li&gt;Use buffered channels for performance-critical code.&lt;/li&gt;
&lt;li&gt;Close channels to avoid deadlocks.&lt;/li&gt;
&lt;li&gt;Use range and select to handle channel operations.&lt;/li&gt;
&lt;li&gt;By mastering channels, you'll be able to write efficient, concurrent, and safe Go programs.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>go</category>
      <category>devops</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>The Kubernetes Glossary Cheatsheet: Essential Terms to Know Before You Start</title>
      <dc:creator>Vaibhav Thukral</dc:creator>
      <pubDate>Sun, 28 Jul 2024 10:09:12 +0000</pubDate>
      <link>https://dev.to/vaibhavt14/the-kubernetes-glossary-essential-terms-to-know-before-you-start-53ld</link>
      <guid>https://dev.to/vaibhavt14/the-kubernetes-glossary-essential-terms-to-know-before-you-start-53ld</guid>
      <description>&lt;p&gt;Learning a new technology or tool can be overwhelming, especially when encountering unfamiliar terminology. &lt;/p&gt;

&lt;p&gt;Even with documentation, understanding these terms can be a challenge. &lt;/p&gt;

&lt;p&gt;To help you get started with Kubernetes, here is a comprehensive list of Kubernetes terminology, along with explanations and practical examples:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Cluster:&lt;/strong&gt; A group of machines (nodes) that run containerized applications.&lt;/p&gt;

&lt;p&gt;Example: A cluster consists of 3 nodes: node1, node2, and node3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Node:&lt;/strong&gt; A machine (physical or virtual) in a Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feuwjydkdesru9jx898eq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feuwjydkdesru9jx898eq.png" alt="Image description" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Pod:&lt;/strong&gt; A pod is the smallest deployable unit in Kubernetes and not containers.&lt;/p&gt;

&lt;p&gt;In Laymen terms think Pod is like a home and rooms are containers &lt;/p&gt;

&lt;p&gt;Example: A Pod named "my-app" runs 2 containers: "app" and "db". so "my-app" is a home and "app" and "db" are each different rooms i.e two different containers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F97983vgz09dvy7rgmjlq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F97983vgz09dvy7rgmjlq.png" alt="Image description" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Container:&lt;/strong&gt; A lightweight and portable way to package applications. &lt;/p&gt;

&lt;p&gt;Example: The "app" container runs a web server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Deployment:&lt;/strong&gt; A way to manage rollouts and rollbacks of Pods.&lt;/p&gt;

&lt;p&gt;Example: A Deployment named "my-app" manages 3 replicas of the "my-app" Pod.&lt;/p&gt;

&lt;p&gt;In Kubernetes, Deployment ensures that your application ("my-app") is always running with 3 instances (replicas), and handles updates and failures automatically! &lt;/p&gt;

&lt;p&gt;By default replicas will have horizontal scaling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. ReplicaSet:&lt;/strong&gt; Ensures a specified number of replicas (Pods) are running at any given time.&lt;/p&gt;

&lt;p&gt;Example: A ReplicaSet named "my-app" ensures 3 replicas of the "my-app" Pod.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Service:&lt;/strong&gt; Provides a network identity and load balancing for accessing Pods.&lt;/p&gt;

&lt;p&gt;Example: A Service named "my-app" exposes the "my-app" Pod on port 80.&lt;/p&gt;

&lt;p&gt;If it still not make sense to you let's understand in laymen's terms&lt;/p&gt;

&lt;p&gt;Try to visualize imagine you have a lemonade stand (Pod) called "my-app", but it's located in a busy market (cluster) with many other stands. &lt;/p&gt;

&lt;p&gt;You want customers to easily find and access your stand, without having to know its exact location.&lt;/p&gt;

&lt;p&gt;A Service named "my-app" is like a signboard that points to your lemonade stand. &lt;/p&gt;

&lt;p&gt;It provides a easy-to-remember name ("my-app") and a clear direction (port 80) for customers to find your stand.&lt;/p&gt;

&lt;p&gt;Here's what the signboard (Service) does:&lt;/p&gt;

&lt;p&gt;Gives your stand a name ("my-app") that's easy to remember&lt;br&gt;
Directs customers to your stand on a specific path (port 80)&lt;br&gt;
If you have multiple stands (Pods) with the same name, the signboard will distribute customers evenly among them (load balancing)&lt;/p&gt;

&lt;p&gt;In Kubernetes, a Service provides a network identity and load balancing for accessing Pods, making it easy for users to access your application without knowing the Pod's location or details!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Persistent Volume (PV):&lt;/strong&gt; A storage resource that persists data beyond Pod lifetimes.&lt;/p&gt;

&lt;p&gt;Example: A PV named "data" stores data for the "db" container.&lt;/p&gt;

&lt;p&gt;Think of it like an external hard drive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Persistent Volume Claim (PVC):&lt;/strong&gt; Requests storage resources from a PV.&lt;/p&gt;

&lt;p&gt;Example: A PVC named "data-claim" requests 1GB of storage from the "data" PV.&lt;/p&gt;

&lt;p&gt;Think of it like asking for space on the external hard drive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Namespace:&lt;/strong&gt; A logical partitioning of resources and objects in a cluster.&lt;/p&gt;

&lt;p&gt;Example: A Namespace named "dev" contains the "my-app" Deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why we need Namespace?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Namespaces help:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep resources organized and separated&lt;/li&gt;
&lt;li&gt;Avoid naming conflicts between resources&lt;/li&gt;
&lt;li&gt;Control access and permissions to resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;11. ConfigMap:&lt;/strong&gt; A way to store configuration data as key-value pairs.&lt;/p&gt;

&lt;p&gt;Example: A ConfigMap named "app-config" stores database credentials.&lt;/p&gt;

&lt;p&gt;Think of it like a sticky note with important info.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. Secret:&lt;/strong&gt; A way to store sensitive data like passwords or API keys.&lt;/p&gt;

&lt;p&gt;Example: A Secret named "db-password" stores the database password.&lt;/p&gt;

&lt;p&gt;Think of it like a locked box with confidential info.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15. Ingress:&lt;/strong&gt; A way to expose Services to external traffic.&lt;/p&gt;

&lt;p&gt;Example: An Ingress named "my-app" exposes the "my-app" Service to the internet.&lt;/p&gt;

&lt;p&gt;Think of it like a sign on the highway pointing to your lemonade stand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17. Kubectl:&lt;/strong&gt; The command-line tool for interacting with Kubernetes.&lt;/p&gt;

&lt;p&gt;Example: kubectl get pods shows the list of running Pods.&lt;/p&gt;

&lt;p&gt;Think of it like a remote control for your Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18. Kube-Proxy:&lt;/strong&gt; It's a network proxy that runs on each Node in a Kubernetes Cluster. &lt;/p&gt;

&lt;p&gt;Its main purpose is to manage communication between Pods and the outside world.&lt;/p&gt;

&lt;p&gt;Hope you like it!!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>learning</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Understanding Pointers in GO: Devops Guide</title>
      <dc:creator>Vaibhav Thukral</dc:creator>
      <pubDate>Wed, 24 Jul 2024 09:28:39 +0000</pubDate>
      <link>https://dev.to/vaibhavt14/understanding-pointers-in-go-devops-guide-3ma9</link>
      <guid>https://dev.to/vaibhavt14/understanding-pointers-in-go-devops-guide-3ma9</guid>
      <description>&lt;p&gt;In this post we will explore about pointers in Go:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What are Pointers?&lt;/li&gt;
&lt;li&gt;Why does feature exist?&lt;/li&gt;
&lt;li&gt;How can you work with pointers?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will work with addresses instead of values.&lt;/p&gt;

&lt;h2&gt;
  
  
  What exactly are "Pointers"?
&lt;/h2&gt;

&lt;p&gt;Pointers are variables that store values &lt;strong&gt;addresses&lt;/strong&gt; instead of values&lt;/p&gt;

&lt;p&gt;It may sound confusing so let's look how your code affects your computer memory&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv0x4ikst95jystgfewov.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv0x4ikst95jystgfewov.png" alt="Image description" width="800" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's say you have create and initialize variable called age set the value of 32 that value 32 stored in a computer's memory that value in memory get automatically address and that address is required by the computer to be able to retrieve that value and work with it.&lt;/p&gt;

&lt;p&gt;But in this case here this value 32 which in our code which stored in variable age is actually also stored in computer memory and every value use in Go is atleast for short period of time stored some where in your computer's memory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbfwg52rrsgo04hy74zt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbfwg52rrsgo04hy74zt.png" alt="Image description" width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now a pointer then is variable where you don't store a value but where you instead use &lt;strong&gt;&amp;amp; -&amp;gt; 'ampersand'&lt;/strong&gt; to get an store the address of value instead of the value itself so &amp;amp;age pointer would contain the address as value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "Pointers"?
&lt;/h2&gt;

&lt;p&gt;When working with pointers you can &lt;strong&gt;avoid unnecessary value copies&lt;/strong&gt; and other benefit of pointers is you can use pointers to &lt;strong&gt;directly mutate values&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;but what exactly do i means with this above advantages? so let's start with these advantage &lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid unnecessary value copies
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6rc879hiyx5dum7zz6jp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6rc879hiyx5dum7zz6jp.png" alt="Image description" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;By default,Go creates a copy when passing values to functions&lt;/li&gt;
&lt;li&gt;For very large and complex values, this  may take up too much memory space unnecessarily &lt;/li&gt;
&lt;li&gt;With pointers, only one value is stored in memory(and the address is passed around)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Directly mutate values
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Pass a pointer(address) instead of a value to a function&lt;/li&gt;
&lt;li&gt;The function can then directly edit the underlying value - no return value is required&lt;/li&gt;
&lt;li&gt;Can lead to a less code (but also to less understandable code or unexpected behaviours)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pointers in Go (also known as Golang) are variables that store the memory address of another variable. Here's a simplified explanation:&lt;/p&gt;

&lt;h3&gt;
  
  
  Declaring Pointers
&lt;/h3&gt;

&lt;p&gt;In Go, pointers are declared using the asterisk symbol (*) before the pointer name. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var ptr *int
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This declares a pointer named ptr that points to an int value.&lt;/p&gt;

&lt;p&gt;Getting the Address of a Variable&lt;/p&gt;

&lt;p&gt;To get the memory address of a variable, use the address-of operator (&amp;amp;). For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x := 10
ptr = &amp;amp;x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sets the pointer ptr to the memory address of the variable x.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dereferencing Pointers
&lt;/h3&gt;

&lt;p&gt;To access the value stored at the memory address held by a pointer, use the dereference operator (*). For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;y := *ptr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sets the variable y to the value stored at the memory address held by ptr, which is 10.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Pointers in Go are used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pass variables by reference to functions&lt;/li&gt;
&lt;li&gt;Return multiple values from functions&lt;/li&gt;
&lt;li&gt;Create data structures like linked lists and trees&lt;/li&gt;
&lt;li&gt;Improve performance by avoiding copying large data structures&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, Go's pointers are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Safe: Go's pointers are bounds-checked, preventing common errors like null pointer dereferences or out-of-bounds access.&lt;/li&gt;
&lt;li&gt;Limited: Go's pointers cannot be arithmetic or cast to other types, making them less error-prone.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>go</category>
      <category>devops</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Why Would You Tag Your Images in Docker?</title>
      <dc:creator>Vaibhav Thukral</dc:creator>
      <pubDate>Mon, 22 Jul 2024 17:40:32 +0000</pubDate>
      <link>https://dev.to/vaibhavt14/tag-matters-why-would-you-tag-your-images-4l7</link>
      <guid>https://dev.to/vaibhavt14/tag-matters-why-would-you-tag-your-images-4l7</guid>
      <description>&lt;p&gt;We know that image name can include an optional tag. &lt;/p&gt;

&lt;p&gt;In this lesson, we will discuss tags in a bit more detail and learn why they are important.&lt;/p&gt;

&lt;p&gt;We knew that image names include a name and a tag. As a quick reminder, an image name is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;repository_name&amp;gt;/&amp;lt;name&amp;gt;:&amp;lt;tag&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;tag is optional; when missing, it is considered to be latest by default&lt;/li&gt;
&lt;li&gt;repository_name can be a registry DNS or the name of a registry in the Docker Hub&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While your images aren’t published to a registry, you don’t need to include a registry name. So, your image name is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;name&amp;gt;:&amp;lt;tag&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The latest tag
&lt;/h2&gt;

&lt;p&gt;I didn’t include a tag; therefore the default latest tag was used. For instance, the actual image name was test:latest when I ran the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t test .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As long as you are creating simple software, running on a simple CI/CD pipeline, it can be fine to use the latest tag. In a simple scenario, you may:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update the source code&lt;/li&gt;
&lt;li&gt;Build a new image with the latest tag&lt;/li&gt;
&lt;li&gt;Run a new container with the newest image&lt;/li&gt;
&lt;li&gt;Kill the previous container&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There’s a caveat with this however: when using the docker run test command on a distant machine (which actually means docker run test:latest), the distant machine has no means to know that there is a newer version of the hello:latest image. &lt;/p&gt;

&lt;p&gt;You need to run the docker pull test command on the distant machine in order for the newest version of your image to be downloaded to that machine.&lt;/p&gt;

&lt;p&gt;This may sound awkward, and that’s one reason for not just using the latest tag.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Would You Tag Your Images?
&lt;/h2&gt;

&lt;p&gt;Other reasons come to mind once you become more serious with your CI/CD pipeline. &lt;/p&gt;

&lt;p&gt;For instance, you may want any or all of the following features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Be able to roll back to a previous version of an image if you detect a problem with the latest image.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run different versions in different environments. For instance, the latest version in a test environment and the previous version in a production environment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run different versions at the same time, routing some users to the latest version and some to the previous versions. This is known as a canary release.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploy different versions to different users, and be able to run whatever version on your development machine while you support them.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are all good reasons for tagging your images. If you ensure each released image has a different tag, you can run any of the scenarios mentioned above.&lt;/p&gt;

&lt;p&gt;You’re free to tag your images however you want. Common tags include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a version number, e.g. test:1.0, test:1.1, test:1.2&lt;/li&gt;
&lt;li&gt;a Git commit tag, e.g. test:2cd7e376, test:b43a14bb&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In order to apply a tag, just state it during your build command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t hello:1.0 .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I recommend specifying the image tag. If you want to keep up to date with new releases of the base image, update the tag manually and make sure you test your image before releasing it.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>devops</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>What is Go lang? and why would you use it?</title>
      <dc:creator>Vaibhav Thukral</dc:creator>
      <pubDate>Sat, 20 Jul 2024 15:59:54 +0000</pubDate>
      <link>https://dev.to/vaibhavt14/what-is-go-lang-and-why-would-you-use-it-1260</link>
      <guid>https://dev.to/vaibhavt14/what-is-go-lang-and-why-would-you-use-it-1260</guid>
      <description>&lt;p&gt;Go is an open-source programming language developed by Google.Its a relatively new programming language it was developed in 2007 and made public in 2009 and extremely popular language.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is open-source exactly?
&lt;/h3&gt;

&lt;p&gt;Open source programming language are those that allow anyone to view, modify, and distribute their source code without restrictions.&lt;/p&gt;

&lt;p&gt;They typically maintained by a community rather than a single entity, promoting collaboration and innovation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why extremely popular language because of it's:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Simplicity, clarity and scalability inspired by languages such as Python it aims to provide a clean, understandable syntax.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High performance and Focus on concurrency and quite similar to C or C++ running multiple task simultaneously.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Batteries included so lot of features built-in so you don't need to  reach of third party libraries for basic tasks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Statically typed language giving you extra type safety and most importantly allows you as a developer to catch many errors early during development.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Popular Use-cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Networking and APIs&lt;/li&gt;
&lt;li&gt;Microservices&lt;/li&gt;
&lt;li&gt;CLI(Command line interface) Tools&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>learning</category>
      <category>go</category>
    </item>
  </channel>
</rss>
