<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Golang on Vivek Kumar Singh</title>
    <link>http://www.viveksyngh.com/tags/golang/</link>
    <description>Recent content in Golang on Vivek Kumar Singh</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 07 Nov 2022 00:00:00 -0600</lastBuildDate>
    <atom:link href="http://www.viveksyngh.com/tags/golang/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Converting Kubernetes Go Types to YAML and vice versa</title>
      <link>http://www.viveksyngh.com/posts/converting-kubernetes-go-types-to-yaml-and-vice-versa/</link>
      <pubDate>Mon, 07 Nov 2022 00:00:00 -0600</pubDate>
      <guid>http://www.viveksyngh.com/posts/converting-kubernetes-go-types-to-yaml-and-vice-versa/</guid>
      <description>In this blog post, we will see how we can encode/decode Kubernetes Go API types to/from Kubernetes YAML.&#xA;When we work with Kubernetes Go API types (custom types or core types), we often need to convert the Go API types into YAML manifest or vice versa. For example, A CLI application&#xA;Which output Kubernetes objects in YAML&#xA;Which takes Kubernetes objects YAML as input&#xA;For demonstration purposes, we will be creating a simple application that creates a Kubernetes ConfigMap object and encodes/decodes it.</description>
    </item>
    <item>
      <title>What’s in Kubernetes client-go — Part 1</title>
      <link>http://www.viveksyngh.com/posts/whats-in-kubernetes-client-go-part-1/</link>
      <pubDate>Sun, 21 Nov 2021 00:00:00 -0600</pubDate>
      <guid>http://www.viveksyngh.com/posts/whats-in-kubernetes-client-go-part-1/</guid>
      <description>Kubernetes project provides a number of the third-party consumable repository under kubernetes or kubernetes-sigs organization on Github. In the series of blog, I will go through such upstream k8s repositories and code, which are needed most frequently to write extensions for Kubernetes. Also provides some examples for using different k8s packages for developing Kubernetes applications in Golang. First covers famous kubernetes package called client-go.&#xA;client-go Link to heading client-go is one of the most useful packages for writing Golang based Kubernetes applications.</description>
    </item>
    <item>
      <title>Getting Started With Golang Interfaces</title>
      <link>http://www.viveksyngh.com/posts/getting-started-with-golang-interfaces/</link>
      <pubDate>Mon, 15 Oct 2018 00:00:00 -0600</pubDate>
      <guid>http://www.viveksyngh.com/posts/getting-started-with-golang-interfaces/</guid>
      <description>Interfaces in Go provides a way to specify the behavior of an object. Interfaces allow us to write more flexible and scalable code in Go. It is also a mechanism to achieve polymorphism in Go.&#xA;type Interface interface { Method1(int, string) (int, error) Method2(int) bool Method3(string) } Interfaces specify methods (or behavior) but do not provide an implementation for those methods. Types implementing the interface provide an implementation of methods.</description>
    </item>
    <item>
      <title>Object Oriented Programming and Golang</title>
      <link>http://www.viveksyngh.com/posts/object-oriented-programming-and-golang/</link>
      <pubDate>Fri, 14 Sep 2018 00:00:00 -0600</pubDate>
      <guid>http://www.viveksyngh.com/posts/object-oriented-programming-and-golang/</guid>
      <description>Go has picked some good concepts from different kind of programming languages like procedural, functional and object-oriented programming language and combined them together to create a unique flavor programming language.&#xA;Go isn’t an object-oriented language like C++, Java, C# etc. but it supports some of the OOPs concepts like Encapsulation, Type Methods, Composition etc.&#xA;In this blog post, we will see how can we implement those concepts in Go&#xA;Type Methods Link to heading Go does not have classes but it has types.</description>
    </item>
    <item>
      <title>Pass by value and Pass by reference in Go</title>
      <link>http://www.viveksyngh.com/posts/pass-by-value-and-pass-by-reference-in-go/</link>
      <pubDate>Fri, 07 Sep 2018 00:00:00 -0600</pubDate>
      <guid>http://www.viveksyngh.com/posts/pass-by-value-and-pass-by-reference-in-go/</guid>
      <description>In Go, everything is passed by value. When we pass arguments to a function, a function always gets the copy of the data passed. For example, passing an int value to function makes a copy of the int, passing a pointer value makes a copy of the pointer but not the data it points to.&#xA;When we pass a value to function it is called pass by value and when we pass a pointer to a function it is called pass by reference.</description>
    </item>
    <item>
      <title>HTTP Response in Golang</title>
      <link>http://www.viveksyngh.com/posts/http-response-in-golang/</link>
      <pubDate>Sat, 01 Sep 2018 00:00:00 -0600</pubDate>
      <guid>http://www.viveksyngh.com/posts/http-response-in-golang/</guid>
      <description>In this blog post, I am going to talk about HTTP server and how to return different types of HTTP response(text, JSON, html) in Go.&#xA;Plain Text Response Link to heading Creating a web server in Go is very simple and we can do it by writing just a few lines of code.We need to use net/http package to create an HTTP server. This is how a simple HTTP server code looks like in Go.</description>
    </item>
    <item>
      <title>Timeout commands in Golang</title>
      <link>http://www.viveksyngh.com/posts/timeout-commands-in-golang/</link>
      <pubDate>Tue, 28 Aug 2018 00:10:34 -0600</pubDate>
      <guid>http://www.viveksyngh.com/posts/timeout-commands-in-golang/</guid>
      <description>Sometimes in our applications, we need to invoke external processes or commands (e.g CURL, Ping, SSH etc.) to perform some tasks. We can use os/exec Go package to invoke external processes. Most of the time we want to invoke these commands with timeouts.&#xA;In this blog post, I am going to talk about different ways in which we can invoke a command with a timeout.&#xA;Timeout with timer Link to heading In this method, we use a timer for the timeout.</description>
    </item>
  </channel>
</rss>
