<?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: vasubabu</title>
    <description>The latest articles on DEV Community by vasubabu (@jinagamvasubabu).</description>
    <link>https://dev.to/jinagamvasubabu</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%2F250966%2Fe6d1f50d-a35b-480b-ba38-bfd0148aa5c0.jpeg</url>
      <title>DEV Community: vasubabu</title>
      <link>https://dev.to/jinagamvasubabu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jinagamvasubabu"/>
    <language>en</language>
    <item>
      <title>Start Goland from terminal</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Thu, 27 Aug 2020 16:10:10 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/start-goland-from-terminal-30p9</link>
      <guid>https://dev.to/jinagamvasubabu/start-goland-from-terminal-30p9</guid>
      <description>&lt;p&gt;Its Very Easy!!!&lt;/p&gt;

&lt;h3&gt;
  
  
  Step1:
&lt;/h3&gt;

&lt;p&gt;Open &lt;code&gt;Goland&lt;/code&gt; and click on &lt;code&gt;Tools -&amp;gt; Create Command-line launcher&lt;/code&gt; and give the path as &lt;code&gt;/usr/local/bin/goland&lt;/code&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7cHoU3W2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/efodvsxc7ofmewtgyrdd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7cHoU3W2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/efodvsxc7ofmewtgyrdd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step2:
&lt;/h3&gt;

&lt;p&gt;Create an alias &lt;br&gt;
&lt;code&gt;alias goland='/usr/local/bin/goland'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Tip: Its better to have this line a startup script, so that restart doesn't revert your changes&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3:
&lt;/h3&gt;

&lt;p&gt;Open terminal and go to your workspace and type &lt;br&gt;
&lt;code&gt;goland .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That's it!!! you will see your IDE opening your favourite project  &lt;/p&gt;

</description>
      <category>go</category>
    </item>
    <item>
      <title>cmd/go: go mod init fails to determine module path in subdirectory</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Thu, 20 Aug 2020 08:11:41 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/cmd-go-go-mod-init-fails-to-determine-module-path-in-subdirectory-296f</link>
      <guid>https://dev.to/jinagamvasubabu/cmd-go-go-mod-init-fails-to-determine-module-path-in-subdirectory-296f</guid>
      <description>&lt;p&gt;I know you came for solution as always i don't talk much ;)&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem:
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;go&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;go&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="n"&gt;init&lt;/span&gt; &lt;span class="n"&gt;fails&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;determine&lt;/span&gt; &lt;span class="n"&gt;module&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;subdirectory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Solutions:
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;#1&lt;/code&gt;: Update your go path to your current working directory (you can specify multiple)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight go"&gt;&lt;code&gt; &lt;span class="n"&gt;export&lt;/span&gt; &lt;span class="n"&gt;GOPATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/Users/XXXX/dir1:/Users/XXXX/dir2"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;code&gt;#2&lt;/code&gt;: if &lt;code&gt;Plan A&lt;/code&gt; not working then &lt;code&gt;Plan B&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;go&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="n"&gt;init&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module_name&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Hopefully &lt;code&gt;Plan B&lt;/code&gt; works, if not please mention in comment section. i can help you :)&lt;/p&gt;

</description>
      <category>go</category>
    </item>
    <item>
      <title>Split/Slice an Array into chunks (golang)</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Tue, 14 Jul 2020 14:02:13 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/split-array-into-chunks-in-golang-40n</link>
      <guid>https://dev.to/jinagamvasubabu/split-array-into-chunks-in-golang-40n</guid>
      <description>&lt;p&gt;Below code talks more :)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "fmt"
)

func main() {
    arr := []int{1, 2, 3, 5, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9}
    limit := 5

    for i := 0; i &amp;lt; len(arr); i += limit {
        batch := arr[i:min(i+limit, len(arr))]
        fmt.Println(batch)
    }

}

func min(a, b int) int {
    if a &amp;lt;= b {
        return a
    }
    return b
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Above code split an array into multiple chunks based on the chunk size. &lt;/p&gt;

&lt;h3&gt;
  
  
  Why can't i use &lt;code&gt;math.Min&lt;/code&gt; ?
&lt;/h3&gt;

&lt;p&gt;Because golang Math function mainly supports &lt;code&gt;float64&lt;/code&gt; instead of int and one more disadvantage of golang is not having support of &lt;code&gt;generics&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Looks like go is getting support of &lt;code&gt;generics&lt;/code&gt; in &lt;code&gt;go 2.0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/golang/go/issues/25597"&gt;https://github.com/golang/go/issues/25597&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>split</category>
      <category>array</category>
      <category>chunk</category>
    </item>
    <item>
      <title>How to Edit your videos for youtube using iMovie</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Thu, 25 Jun 2020 14:52:10 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/how-to-edit-your-videos-for-youtube-using-imovie-3nl1</link>
      <guid>https://dev.to/jinagamvasubabu/how-to-edit-your-videos-for-youtube-using-imovie-3nl1</guid>
      <description>&lt;p&gt;For any New YouTuber, the biggest hurdle is video editing. In this video, I am going to show you how to edit your videos like a PRO using iMovie&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.youtube.com/watch?feature=player_embedded&amp;amp;v=YupriEz7YMg&amp;lt;br&amp;gt;%0A"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R3PkooOs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://img.youtube.com/vi/YupriEz7YMg/0.jpg" alt="Video editing using iMovie" width="240" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: Click on the above page to redirect to youtube&lt;/p&gt;

&lt;p&gt;This is a step by step based tutorial, you can directly skip to the respective topic if you don't want to watch the entire video. Please find the timestamps below:&lt;/p&gt;

&lt;p&gt;2:12 Import Media&lt;br&gt;
2:36 Add Videos to Timeline &lt;br&gt;
3:14 Adding Voiceover&lt;br&gt;&lt;br&gt;
5:15 Adding Tiles &lt;br&gt;
6:30 Adding Transitions &lt;br&gt;
7:26 Adding Timelapse Effect &lt;br&gt;
9:48 Adding an image (logo) &lt;br&gt;
13:50 Green Screen Effects &lt;br&gt;
17:29 Animation using Keynote &lt;br&gt;
18:53 Animated Intro &lt;br&gt;
21:00 Remove BG Noise &lt;br&gt;
21:47 Export to Media &lt;/p&gt;

</description>
      <category>imovie</category>
      <category>videoediting</category>
      <category>editing</category>
      <category>vasubabu</category>
    </item>
    <item>
      <title>Solution: Polygons and MultiPolygons should follow the right-hand rule</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Thu, 25 Jun 2020 12:41:37 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/solution-polygons-and-multipolygons-should-follow-the-right-hand-rule-2c8i</link>
      <guid>https://dev.to/jinagamvasubabu/solution-polygons-and-multipolygons-should-follow-the-right-hand-rule-2c8i</guid>
      <description>&lt;p&gt;I use OpenStreetMaps/Datahub.io to get the polygon data for an area.&lt;br&gt;
For Country polygons, I prefer Datahub.io and others I prefer Open street maps.&lt;/p&gt;

&lt;p&gt;Links:&lt;br&gt;
&lt;a href="https://nominatim.openstreetmap.org/search.php?q=liege&amp;amp;polygon_geojson=1&amp;amp;format=json"&gt;https://nominatim.openstreetmap.org/search.php?q=liege&amp;amp;polygon_geojson=1&amp;amp;format=json&lt;/a&gt;&lt;br&gt;
Note: Please change q=liege to your desired place and nominatim is the UI built on top of OSM.&lt;br&gt;
&lt;a href="https://datahub.io/core/geo-countries#resource-countries"&gt;Datahub.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;sometimes you may see the below error while validating a Geo-JSON data downloaded using &lt;a href="https://geojsonlint.com"&gt;https://geojsonlint.com&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Line 1: Polygons and MultiPolygons should follow the right-hand rule
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nZ1T7IvF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xbjkh8qlqhqicc9dfiy9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nZ1T7IvF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xbjkh8qlqhqicc9dfiy9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is because the Geo-JSON data is not following the Right-Hand rule. &lt;/p&gt;

&lt;h4&gt;
  
  
  What is a Right-Hand rule?
&lt;/h4&gt;

&lt;p&gt;When you construct a polygon, you can order the coordinates in one direction or another. If you’re drawing a circle, you might start on the left and go counter-clockwise around to meet the original point. Or, you might go clockwise.&lt;/p&gt;

&lt;h4&gt;
  
  
  Here is the specification:
&lt;/h4&gt;

&lt;p&gt;A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="http://mapster.me/right-hand-rule-geojson-fixer/"&gt;mapster&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fix: Its very hard to convert the Geo-Json data according to Right hand rule, one way is use this tool to do that&lt;/p&gt;

&lt;p&gt;&lt;a href="http://mapster.me/right-hand-rule-geojson-fixer/"&gt;http://mapster.me/right-hand-rule-geojson-fixer/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f0W4K50g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/88esdi2whr5r06mptl66.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f0W4K50g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/88esdi2whr5r06mptl66.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Geo-JSON Lint:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BvTARtqI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5ucw9l578ch2leyhpmic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BvTARtqI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5ucw9l578ch2leyhpmic.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>polygon</category>
      <category>righthandrule</category>
      <category>openstreetmaps</category>
      <category>vasubabu</category>
    </item>
    <item>
      <title>[Easy]: Truncate a table and restart Sequences (Identity and cascade)</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Thu, 18 Jun 2020 07:55:50 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/easy-truncate-a-table-and-restart-sequences-identity-and-cascade-1hjp</link>
      <guid>https://dev.to/jinagamvasubabu/easy-truncate-a-table-and-restart-sequences-identity-and-cascade-1hjp</guid>
      <description>&lt;p&gt;Sometimes you may have to delete or truncate your records in the table for your local or dev testing. Easy way is to do with the below command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  delete from &amp;lt;table&amp;gt; where &amp;lt;condition&amp;gt; = &amp;lt;value&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This Works!!!&lt;/p&gt;

&lt;p&gt;But above command doesn't restart the sequences i.e; &lt;code&gt;IDENTITY&lt;/code&gt; and &lt;code&gt;CASCADE&lt;/code&gt; associated with table columns.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; TRUNCATE &amp;lt;table_name&amp;gt; RESTART IDENTITY CASCADE;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;References:&lt;br&gt;
&lt;a href="https://stackoverflow.com/questions/5342440/reset-auto-increment-counter-in-postgres"&gt;Stack Overflow&lt;/a&gt;&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>sql</category>
    </item>
    <item>
      <title>Edit your commit messages in GIT</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Fri, 27 Mar 2020 07:15:33 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/edit-your-commit-messages-in-git-5df5</link>
      <guid>https://dev.to/jinagamvasubabu/edit-your-commit-messages-in-git-5df5</guid>
      <description>&lt;p&gt;Sometimes intentionally or unintentionally you may have given a wrong commit message due to various reasons.&lt;/p&gt;

&lt;p&gt;But don't worry...&lt;/p&gt;

&lt;p&gt;You can change your commit messages with GIT &lt;code&gt;rebase&lt;/code&gt; command.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Checkout Branch
&lt;/h3&gt;

&lt;p&gt;checkout your branch where you want to change your commit messages&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Step2: Pull last N commits
&lt;/h3&gt;

&lt;p&gt;Rebase will help you modify your commit messages, squash and merge all your commits into one, but this tutorial is mainly to edit your messages. I will talk more about &lt;code&gt;rebase&lt;/code&gt; in another tutorial.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;rebase&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="nx"&gt;HEAD&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="nx"&gt;N&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;code&gt;display a list of the last&lt;/code&gt;N&lt;code&gt;commits in your default text editor.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zG0kubit--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/j0wdaapuvooccesqv5yh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zG0kubit--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/j0wdaapuvooccesqv5yh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step3: Long live &lt;code&gt;Reword&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Replace pick with reword before each commit message you want to change.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EzuIM0Fa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9zcujuaamz9uttp6q7os.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EzuIM0Fa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9zcujuaamz9uttp6q7os.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Use force sometimes
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;push&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Have a break !!!!
&lt;/h3&gt;

</description>
      <category>git</category>
      <category>edit</category>
      <category>commit</category>
      <category>vasubabu</category>
    </item>
    <item>
      <title>Solution: UnSupported Protocol scheme golang issue</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Thu, 05 Dec 2019 06:03:55 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/solution-unsupported-protocol-scheme-golang-issue-2m5k</link>
      <guid>https://dev.to/jinagamvasubabu/solution-unsupported-protocol-scheme-golang-issue-2m5k</guid>
      <description>&lt;p&gt;Recently I had faced an issue while using &lt;code&gt;net/http&lt;/code&gt; to get the resource from an URL:&lt;/p&gt;

&lt;p&gt;Here is my program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "fmt"
    "log"
    "net/http"
)

type WebScrapper interface {
    PullContent(url string)
}

type webScrapper struct {
}

func (w *webScrapper) PullContent(url string) {
    resp, err := http.Get(url)

    if err != nil {
        panic(err)
    }

    defer (func() {
        if r := recover(); r != nil {
            fmt.Printf("Recovered from panic %s", r)
        }
    })()

    log.Printf("Got response for %s and status is %s", url, resp.Status)
}

func main() {
    w := webScrapper{}
    urls := []string{
        "www.google.com",
        "www.facebook.com",
        "www.gmail.com",
    }

    for i := 0; i &amp;lt; len(urls); i++ {
        w.PullContent(urls[i])
    }

}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;yes its a lot of code, but don't worry about code having interfaces and structs and defer. The code is breaking mainly at getting resource from URL.&lt;/p&gt;

&lt;p&gt;Error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Get www.google.com: unsupported protocol scheme ""

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;To fix &lt;code&gt;unsupported protocol scheme&lt;/code&gt; prepend &lt;code&gt;http://&lt;/code&gt; before every URL.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;urls := []string{
        "http://www.google.com",
        "http://www.facebook.com",
        "http://www.gmail.com",
    }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That's it!!! &lt;/p&gt;

</description>
      <category>go</category>
      <category>http</category>
      <category>vasubabu</category>
    </item>
    <item>
      <title>How to POST multipart/form-data in GO using Mux</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Mon, 04 Nov 2019 16:42:21 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/how-to-post-multipart-form-data-in-go-using-mux-22kp</link>
      <guid>https://dev.to/jinagamvasubabu/how-to-post-multipart-form-data-in-go-using-mux-22kp</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/gorilla/mux" rel="noopener noreferrer"&gt;Mux&lt;/a&gt; is a powerful HTTP router that matches incoming requests against a list of registered routes and calls a handler for the route that matches the URL or other conditions.&lt;/p&gt;

&lt;p&gt;Enough talking ....&lt;/p&gt;

&lt;p&gt;Please create a new file called &lt;code&gt;main.go&lt;/code&gt; and paste the below contents&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

package main

import (
    "fmt"
    "github.com/gorilla/mux"
    "io"
    "log"
    "net/http"
    "os"
)

func UploadFile(w http.ResponseWriter, r *http.Request) {
    file, handler, err := r.FormFile("file")
    fileName := r.FormValue("file_name")
    if err != nil {
        panic(err)
    }
    defer file.Close()

    f, err := os.OpenFile(handler.Filename, os.O_WRONLY|os.O_CREATE, 0666)
    if err != nil {
        panic(err)
    }
    defer f.Close()
    _, _ = io.WriteString(w, "File "+fileName+" Uploaded successfully")
    _, _ = io.Copy(f, file)
}

func homeLink(w http.ResponseWriter, r *http.Request) {
    _, _ = fmt.Fprintf(w, "Welcome home!")
}

func main() {
    router := mux.NewRouter().StrictSlash(true)
    router.HandleFunc("/", homeLink)
    router.HandleFunc("/file", UploadFile).Methods("POST")
    log.Fatal(http.ListenAndServe(":8081", router))
}



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Build it - &lt;code&gt;go build&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run it - &lt;code&gt;go run main.go&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Test it - Using Postman/Curl&lt;/p&gt;

&lt;h3&gt;
  
  
  Postman:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2FL51TdHG%2FScreenshot-2019-11-04-at-9-57-27-PM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2FL51TdHG%2FScreenshot-2019-11-04-at-9-57-27-PM.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CURL:
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

curl -X POST \
  http://localhost:8081/file \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 4251' \
  -H 'Content-Type: multipart/form-data; boundary=--------------------------489143350034706567613009' \
  -H 'Host: localhost:8081' \
  -H 'Postman-Token: fea94e80-8294-4f0b-87bf-09b706eddac8,1bbb735b-f88d-4194-a1b5-f8cd90189545' \
  -H 'User-Agent: PostmanRuntime/7.17.1' \
  -H 'cache-control: no-cache' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F file=@/Users/vasubabujinagam/Documents/protobuf-3.9.2/CONTRIBUTORS.txt \
  -F file_name=file1


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>go</category>
      <category>upload</category>
      <category>mux</category>
      <category>vasubabu</category>
    </item>
    <item>
      <title>Customize Fish Shell</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Fri, 01 Nov 2019 10:16:04 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/customize-fish-shell-e4m</link>
      <guid>https://dev.to/jinagamvasubabu/customize-fish-shell-e4m</guid>
      <description>&lt;p&gt;Recently I got a chance to taste the &lt;code&gt;fish&lt;/code&gt; and I must say it's awesome even though I am totally into bash till now. This Fish Shell is a fully-equipped command line shell that is smart and user-friendly. &lt;/p&gt;

&lt;p&gt;There are multiple reasons to say that it is the best tool and some of them are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Intelligent Auto Suggestions&lt;/li&gt;
&lt;li&gt;Themes support&lt;/li&gt;
&lt;li&gt;Scripting support - &lt;code&gt;Let's talk about it more!!!&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find a hell number of articles about this, but I wanted to stress more on customizing your existing Fish shell. &lt;/p&gt;

&lt;p&gt;One of my biggest questions when I initially started using &lt;code&gt;Fish&lt;/code&gt; was &lt;code&gt;how to migrate my existing bash profile to Fish Shell?&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;The answer is &lt;code&gt;Fairly Simple&lt;/code&gt; - Easy peasy!!!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;~/bash_profile:&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias idea='open -a "`ls -dt /Applications/GoLand.app|head -1`"'
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home

function .runElasticSearch() {
  docker run -p 9200:9200 -p 9300:9300 --name elastic -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.4.0

docker run --link elastic:elasticsearch -p 5601:5601 {docker-repo}:{version}

}

function .runZookeeper() {
  cd /Users/vasubabujinagam/Documents/softwares/zookeeper/bin
  ./zkServer.sh start
}

function .stopZookeeper() {
   cd /Users/vasubabujinagam/Documents/softwares/zookeeper/bin
  ./zkServer.sh stop
}

function .runKafka() {
  cd /Users/vasubabujinagam/Documents/softwares/kafka_2.11
  ./bin/kafka-server-start.sh config/server.properties
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This is how fish functions looks like:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Fish: ~/.config/fish/config.fish&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias idea='open -a "`ls -dt /Applications/GoLand.app|head -1`"'

set -x JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home 

function .runElasticSearch
  docker run -p 9200:9200 -p 9300:9300 --name elastic -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.4.0

docker run --link elastic:elasticsearch -p 5601:5601 {docker-repo}:{version}
end

function .runZookeeper 
  cd /Users/vasubabujinagam/Documents/softwares/zookeeper/bin
  ./zkServer.sh start
end

function .stopZookeeper 
   cd /Users/vasubabujinagam/Documents/softwares/zookeeper/bin
  ./zkServer.sh stop
end

function .runKafka() 
  cd /Users/vasubabujinagam/Documents/softwares/kafka_2.11
  ./bin/kafka-server-start.sh config/server.properties
end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can see there are not much differences from &lt;code&gt;Bash&lt;/code&gt; to &lt;code&gt;Fish&lt;/code&gt;. Happy Fishing!!!&lt;/p&gt;

</description>
      <category>fish</category>
      <category>fishshell</category>
      <category>jinagamvasubabu</category>
      <category>bash</category>
    </item>
    <item>
      <title>Upgrading GO version to 1.13 is not a cakewalk!!!</title>
      <dc:creator>vasubabu</dc:creator>
      <pubDate>Wed, 16 Oct 2019 11:04:58 +0000</pubDate>
      <link>https://dev.to/jinagamvasubabu/upgrading-go-version-to-1-13-is-not-a-cakewalk-3e3a</link>
      <guid>https://dev.to/jinagamvasubabu/upgrading-go-version-to-1-13-is-not-a-cakewalk-3e3a</guid>
      <description>&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;p&gt;Be aware that upgrading the version of Go from older versions to 1.13 is not so easy, it comes with new difficulties due to these recent changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Version validation:

&lt;ul&gt;
&lt;li&gt;In 1.13 Go performs additional validation on the requested version string. The &lt;code&gt;+incompatible&lt;/code&gt; version annotation bypasses the requirement of semantic import versioning for repositories that predate the introduction of modules. The go command now verifies that such a version does not include an explicit go.mod file.
Refer for more info &lt;code&gt;https://golang.org/doc/go1.13#/version-validation&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Changes to the Environment Variable &lt;code&gt;&lt;a href="https://golang.org/doc/go1.13#/proxy-vars"&gt;https://golang.org/doc/go1.13#/proxy-vars&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Proxy Servers:

&lt;ul&gt;
&lt;li&gt;If your company having private repositories then you need to set these below environment variables

&lt;ul&gt;
&lt;li&gt;go env -w GONOSUMDB="****" # use your github or bitbucket repo base url&lt;/li&gt;
&lt;li&gt;go env -w GONOPROXY="****" # use your github or bitbucket repo base url&lt;/li&gt;
&lt;li&gt;go env -w GOPROXY="&lt;a href="https://proxy.golang.org,direct"&gt;https://proxy.golang.org,direct&lt;/a&gt;" #this should already be the default&lt;/li&gt;
&lt;li&gt;go env -w GOPRIVATE="****" # use your github or bitbucket repo base url&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before start upgrading first clean your mod cache:&lt;br&gt;
&lt;code&gt;GO111MODULE=on go clean -modcache&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I will be listing out the possible errors and it's respective solutions as well. &lt;/p&gt;

&lt;h4&gt;
  
  
  #1: If you are using go-micro framework
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go: bitbucket.org/****/**** requires
    github.com/micro/go-plugins@v0.25.0 requires
    gocloud.dev@v0.10.0 requires
    contrib.go.opencensus.io/exporter/ocagent@v0.4.2 requires
    github.com/census-instrumentation/opencensus-proto@v0.1.0-0.20181214143942-ba49f56771b8: invalid pseudo-version: version before v0.1.0 would have   negative patch number
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  fix:
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add this at last in your `go.mod` file
replace github.com/census-instrumentation/opencensus-proto v0.1.0-0.20181214143942-ba49f56771b8 =&amp;gt; github.com/census-instrumentation/opencensus-proto v0.0.3-0.20181214143942-ba49f56771b8
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  #2: &lt;code&gt;Protobuf&lt;/code&gt; related problems
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go: k8s.io/api@v0.0.0-20190726022912-69e1bce1dad5 requires
    github.com/gogo/protobuf@v0.0.0-20190410021324-65acae22fc9: invalid pseudo-version: revision is shorter than canonical (65acae22fc9d)
S
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  fix:
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add this at last in your `go.mod` file
replace github.com/gogo/protobuf v0.0.0-20190410021324-65acae22fc9 =&amp;gt; github.com/gogo/protobuf v0.0.0-20190723190241-65acae22fc9d
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  #3: &lt;code&gt;github.com/instana/go-sensor&lt;/code&gt; related
&lt;/h4&gt;

&lt;h4&gt;
  
  
  fix:
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add this at last in your `go.mod` file
replace github.com/instana/go-sensor =&amp;gt; github.com/instana/golang-sensor v1.5.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  #4: Issue with &lt;code&gt;mailgun-go&lt;/code&gt;
&lt;/h4&gt;

&lt;h4&gt;
  
  
  fix:
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add this at last in your `go.mod` file
replace github.com/mailgun/mailgun-go =&amp;gt; github.com/mailgun/mailgun-go v0.0.0-20180718145431-bbe57f98d550
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  #5: Issue with &lt;code&gt;hashicorp&lt;/code&gt; ambiguous import issue
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cannot load github.com/hashicorp/consul/api: ambiguous import: found github.com/hashicorp/consul/api in multiple modules:
        github.com/hashicorp/consul v1.4.4 (/Users/vasubabujinagam/go/pkg/mod/github.com/hashicorp/consul@v1.4.4/api)
        github.com/hashicorp/consul/api v1.1.0 (/Users/vasubabujinagam/go/pkg/mod/github.com/hashicorp/consul/api@v1.1.0)
S
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  fix:
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add this at last in your `go.mod` file
replace github.com/hashicorp/consul =&amp;gt; github.com/hashicorp/consul v1.5.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;if you are facing anything other than this, please post in the comment section.&lt;/p&gt;

</description>
      <category>go</category>
      <category>upgrade</category>
      <category>jinagam</category>
      <category>vasubabu</category>
    </item>
  </channel>
</rss>
