<?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/categories/golang/</link>
    <description>Recent content in Golang on Vivek Kumar Singh</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 15 Oct 2018 00:00:00 -0600</lastBuildDate>
    <atom:link href="http://www.viveksyngh.com/categories/golang/index.xml" rel="self" type="application/rss+xml" />
    <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>
