{"id":2808,"date":"2018-07-31T17:31:58","date_gmt":"2018-07-31T12:01:58","guid":{"rendered":"https:\/\/codingislove.com\/?p=2808"},"modified":"2018-07-31T17:36:01","modified_gmt":"2018-07-31T12:06:01","slug":"test-driven-development-golang","status":"publish","type":"post","link":"https:\/\/codingislove.com\/test-driven-development-golang\/","title":{"rendered":"Test driven development with golang"},"content":{"rendered":"<p><img decoding=\"async\" class=\"center-block\" src=\"https:\/\/i.imgur.com\/VlAC4sQ.png\" alt=\"Test driven development with golang\" \/><\/p>\n<p>Testing &#8211; An activity dreaded by most human beings<br \/>\nTesting is an investigation done to make sure that the code we have written is reliable and meets the given requirements. The most common way to test code is to write unit tests for different units of the code base. This makes it easy to isolate the bugs in the code base. All of the software development processes include testing as an integral part. The one we are going to talk about today is called Test Driven Development or TDD in short.<\/p>\n<p><!--more--><\/p>\n<p>Test-driven development is a process where tests are written before writing any code. And the code is written only to pass those tests. I know this sounds stupid, but believe me, this is a very effective software development practice. This practice ensures that we only write code that is absolutely required. So, our code is very minimalistic and meets all requirements.<\/p>\n<p>The general idea of TDD is, get requirements, write a test case assuming that there is code fulfilling it, write code to pass the test case. And this process is repeated until all the requirements are met. As you can see, this is a very iterative process. These 3 steps are better known as the 3 laws of test-driven development coined by Robert Cecil Martin (uncle bob). Uncle Bob is one of the living legends of programming. I recommend following his work if you are into good practices in programming.<br \/>\n<img decoding=\"async\" class=\"center-block\" src=\"https:\/\/i.imgur.com\/W3HlSWm.png\" alt=\"Test-driven development flow\" \/><\/p>\n<h3>The 3 laws of test-driven development are formally stated as follows<\/h3>\n<ol>\n<li>You can\u2019t write any production code until you have first written a failing unit test<\/li>\n<li>You can\u2019t write more of a unit test than is sufficient to fail, and not compiling is failing<\/li>\n<li>You can\u2019t write more production code than is sufficient to pass the currently failing unit test<\/li>\n<\/ol>\n<p>Enough of theory let&#8217;s take up an example and actually try it hands on. We will be using golang to implement this concept.<\/p>\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- Cil_responsive -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-2004922017836286\"\r\n     data-ad-slot=\"1504823406\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n(adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\n<h3>Hands on<\/h3>\n<p>Let&#8217;s build a simple function to list the multiples of 3 and 5 within a given range of numbers. This is a fairly simple problem to solve. Let&#8217;s look at the code step by step.<\/p>\n<ul>\n<li>Create a package called <code>tdd<\/code><\/li>\n<li>Now, we will need two files in this package: <code>tdd.go<\/code> and <code>tdd_test.go<\/code>. <code>tdd.go<\/code> will contain the main code and <code>tdd_test.go<\/code> will contain the test cases.<\/li>\n<li>We are going to use a library called testify to write testcases. It&#8217;s very straight forward and easy to understand. First, let&#8217;s install the library by running<br \/>\n<code>go get github.com\/stretchr\/testify<\/code><\/li>\n<li>Lets look at the requirements for writing the function.\n<ol>\n<li>Return multiples of 3<\/li>\n<li>Return multiples of 5 along with it<\/li>\n<li>Return empty slice if multiples of 3 and 5 are not found<\/li>\n<\/ol>\n<\/li>\n<li>According to the laws of TDD, we have to write the test case first. So let&#8217;s take the first requirement and write a test case for it. In <code>tdd_test.go<\/code>, make a function called <code>TestMultiples()<\/code>. And as usual, the arguement of this function should be the <code>T<\/code> object of the builtin paskage called <code>testing<\/code>.<\/li>\n<li>In this function we are going to write the test cases for the function <code>Multiples()<\/code> which will write later. Now, let&#8217;s write our test case for the first requirement (assuming <code>Multiples()<\/code> already exists. Using the <code>assert.Equal()<\/code> let&#8217;s see if calling <code>Multiples(1, 5)<\/code> will give us a slice containing 3 (which is the only multiple of 3 between 1 and 5). The code should look like this.\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfunc TestMultiples(t *testing.T) {\r\n\t\/\/ Return multiples of 3\r\n\tassert.Equal(t, &#x5B;]int{3}, Multiples(1, 5))\r\n}\t\r\n<\/pre>\n<\/li>\n<li>Run the test by running <code>go test<\/code> in the terminal. This test will obviously fail. Now, we write some code to pass this test.<\/li>\n<li>Go to the <code>tdd.go<\/code> file and declare a function called <code>Multiples()<\/code>. Take <code>(m, n int)<\/code> and the arguments as expected by the test case. That defines the range of numbers. We need to look for multiples within this range. Now, the test case expects to get multiples of 3. Multiples of 3 means if the number is divided by 3, it should not give any reminder. So, let&#8217;s iterate through all the numbers between m and n, and return all the numbers that fit.\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfunc Multiples(m, n int) &#x5B;]int {\r\n\tresult := &#x5B;]int{}\r\n\tfor i := m; i &lt; n; i++ {\r\n\t\tif i%3 == 0 {\r\n\t\t\tresult = append(result, i)\r\n\t\t}\r\n\t}\r\n\treturn result\r\n}\r\n<\/pre>\n<\/li>\n<li>If you run the test case now, you will see that it passes! (Think about it. Was it not oddly satisfying?). Since the test case passes, go back to write a new test case.<\/li>\n<li>The next requirement is to also include multiples of 5. So, in our new test case, let call <code>Multiples(4, 11)<\/code> and expect it to return <code>[5, 6, 9, 10]<\/code>. Write the test case and run the test to see that it fails.\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfunc TestMultiples(t *testing.T) {\r\n\t\/\/ Return multiples of 3\r\n\tassert.Equal(t, &#x5B;]int{3}, Multiples(1, 5))\r\n\r\n\t\/\/ Return multiples of 5 also\r\n\tassert.Equal(t, &#x5B;]int{5, 6, 9, 10}, Multiples(4, 11))\r\n}\r\n<\/pre>\n<\/li>\n<li>In <code>Multiples()<\/code> function, we just have to add another condition to also include multiples of 5. Update the <code>if<\/code> condition to do so. And run the test again. It should pass now.\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfunc Multiples(m, n int) &#x5B;]int {\r\n\tresult := &#x5B;]int{}\r\n\tfor i := m; i &lt; n; i++ {\r\n\t\tif i%3 == 0 || i%5 == 0 {\r\n\t\t\tresult = append(result, i)\r\n\t\t}\r\n\t}\r\n\treturn result\r\n}\r\n<\/pre>\n<\/li>\n<li>Now for the last test case. The requirement is to make sure we return an empty slice if no multiples are found. Write the test case to expect <code>Multiples(1, 3)<\/code> to return an empty slice and run the test.\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfunc TestMultiples(t *testing.T) {\r\n\t\/\/ Return multiples of 3\r\n\tassert.Equal(t, &#x5B;]int{3}, Multiples(1, 5))\r\n\r\n\t\/\/ Return multiples of 5 also\r\n\tassert.Equal(t, &#x5B;]int{5, 6, 9, 10}, Multiples(4, 11)) \r\n\r\n\t\/\/ Return empty slice if multiples not found\r\n\tassert.Empty(t, &#x5B;]int{}, Multiples(1, 3))\r\n}\r\n<\/pre>\n<p>You will see that this test case passes without having to write any code. Congratulations!<\/li>\n<\/ul>\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- Cil_medium_rect -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:inline-block;width:300px;height:250px\"\r\n     data-ad-client=\"ca-pub-2004922017836286\"\r\n     data-ad-slot=\"7882954520\"><\/ins>\r\n<script>\r\n(adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\n<p>This process is long and pointless for a small problem like this. But when you write complicated code that affects millions of people, this process could save your life. Sure it&#8217;s a bit slow. But since you are writing good and clean code, you will never be slowed down by bad code. Also, the test coverage will be pretty high when you follow TDD. In fact, in our case, it is 100%.<\/p>\n<p>So, this was Test-driven development in a nutshell. Hope this post gave you a perspective on how TDD could be useful. This may not be the most efficient way when you have a deadline, but it is definitely the most foolproof way to write clean code.<\/p>\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- Cil_responsive -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-2004922017836286\"\r\n     data-ad-slot=\"1504823406\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n(adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\n<div style=\"margin-top: 15px; margin-bottom: 15px;\" class=\"sharethis-inline-share-buttons\" ><\/div>","protected":false},"excerpt":{"rendered":"<p>Testing &#8211; An activity dreaded by most human beings Testing is an investigation done to make sure that the code we have written is reliable&hellip; <\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3,28],"tags":[102,101,100],"class_list":["post-2808","post","type-post","status-publish","format-standard","hentry","category-tutorials","category-quick-tips-for-developers","tag-golang","tag-software","tag-testing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Test driven development with golang - Coding is Love<\/title>\n<meta name=\"description\" content=\"This is an easy to understand practical guide about test-driven development in golang. The 3 laws of TDD introduced by bob martin is explained in simple words with examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codingislove.com\/test-driven-development-golang\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Test driven development with golang - Coding is Love\" \/>\n<meta property=\"og:description\" content=\"This is an easy to understand practical guide about test-driven development in golang. The 3 laws of TDD introduced by bob martin is explained in simple words with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codingislove.com\/test-driven-development-golang\/\" \/>\n<meta property=\"og:site_name\" content=\"Coding is Love\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/codingislove\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-31T12:01:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-07-31T12:06:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i.imgur.com\/VlAC4sQ.png\" \/>\n<meta name=\"author\" content=\"Arjun Mahishi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codingislove\" \/>\n<meta name=\"twitter:site\" content=\"@codingislove\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arjun Mahishi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codingislove.com\/test-driven-development-golang\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codingislove.com\/test-driven-development-golang\/\"},\"author\":{\"name\":\"Arjun Mahishi\",\"@id\":\"https:\/\/codingislove.com\/#\/schema\/person\/2170d4dd4bb588bc33fe87cab26d2738\"},\"headline\":\"Test driven development with golang\",\"datePublished\":\"2018-07-31T12:01:58+00:00\",\"dateModified\":\"2018-07-31T12:06:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codingislove.com\/test-driven-development-golang\/\"},\"wordCount\":1065,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/codingislove.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codingislove.com\/test-driven-development-golang\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i.imgur.com\/VlAC4sQ.png\",\"keywords\":[\"Golang\",\"software\",\"Testing\"],\"articleSection\":[\"Coding Tutorials\",\"Quick tips for developers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codingislove.com\/test-driven-development-golang\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codingislove.com\/test-driven-development-golang\/\",\"url\":\"https:\/\/codingislove.com\/test-driven-development-golang\/\",\"name\":\"Test driven development with golang - Coding is Love\",\"isPartOf\":{\"@id\":\"https:\/\/codingislove.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codingislove.com\/test-driven-development-golang\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codingislove.com\/test-driven-development-golang\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i.imgur.com\/VlAC4sQ.png\",\"datePublished\":\"2018-07-31T12:01:58+00:00\",\"dateModified\":\"2018-07-31T12:06:01+00:00\",\"description\":\"This is an easy to understand practical guide about test-driven development in golang. The 3 laws of TDD introduced by bob martin is explained in simple words with examples.\",\"breadcrumb\":{\"@id\":\"https:\/\/codingislove.com\/test-driven-development-golang\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codingislove.com\/test-driven-development-golang\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codingislove.com\/test-driven-development-golang\/#primaryimage\",\"url\":\"https:\/\/i.imgur.com\/VlAC4sQ.png\",\"contentUrl\":\"https:\/\/i.imgur.com\/VlAC4sQ.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codingislove.com\/test-driven-development-golang\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Coding is Love\",\"item\":\"https:\/\/codingislove.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Coding Tutorials\",\"item\":\"https:\/\/codingislove.com\/category\/tutorials\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Test driven development with golang\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codingislove.com\/#website\",\"url\":\"https:\/\/codingislove.com\/\",\"name\":\"Coding is Love\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/codingislove.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codingislove.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codingislove.com\/#organization\",\"name\":\"Coding is Love\",\"url\":\"https:\/\/codingislove.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codingislove.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/codingislove.com\/wp-content\/uploads\/2015\/12\/codinglovenew.png\",\"contentUrl\":\"https:\/\/codingislove.com\/wp-content\/uploads\/2015\/12\/codinglovenew.png\",\"width\":300,\"height\":225,\"caption\":\"Coding is Love\"},\"image\":{\"@id\":\"https:\/\/codingislove.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/codingislove\/\",\"https:\/\/x.com\/codingislove\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codingislove.com\/#\/schema\/person\/2170d4dd4bb588bc33fe87cab26d2738\",\"name\":\"Arjun Mahishi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codingislove.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3a7d299055a500f67ec441d5106e96c83ee68f12f187320df06b65ac35c5951e?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3a7d299055a500f67ec441d5106e96c83ee68f12f187320df06b65ac35c5951e?s=96&d=wavatar&r=g\",\"caption\":\"Arjun Mahishi\"},\"description\":\"Human by birth, machine by behaviour, geek by choice.\",\"sameAs\":[\"http:\/\/arjunmahishi.github.io\"],\"url\":\"https:\/\/codingislove.com\/author\/arjunmahishi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Test driven development with golang - Coding is Love","description":"This is an easy to understand practical guide about test-driven development in golang. The 3 laws of TDD introduced by bob martin is explained in simple words with examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codingislove.com\/test-driven-development-golang\/","og_locale":"en_US","og_type":"article","og_title":"Test driven development with golang - Coding is Love","og_description":"This is an easy to understand practical guide about test-driven development in golang. The 3 laws of TDD introduced by bob martin is explained in simple words with examples.","og_url":"https:\/\/codingislove.com\/test-driven-development-golang\/","og_site_name":"Coding is Love","article_publisher":"https:\/\/facebook.com\/codingislove\/","article_published_time":"2018-07-31T12:01:58+00:00","article_modified_time":"2018-07-31T12:06:01+00:00","og_image":[{"url":"https:\/\/i.imgur.com\/VlAC4sQ.png","type":"","width":"","height":""}],"author":"Arjun Mahishi","twitter_card":"summary_large_image","twitter_creator":"@codingislove","twitter_site":"@codingislove","twitter_misc":{"Written by":"Arjun Mahishi","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codingislove.com\/test-driven-development-golang\/#article","isPartOf":{"@id":"https:\/\/codingislove.com\/test-driven-development-golang\/"},"author":{"name":"Arjun Mahishi","@id":"https:\/\/codingislove.com\/#\/schema\/person\/2170d4dd4bb588bc33fe87cab26d2738"},"headline":"Test driven development with golang","datePublished":"2018-07-31T12:01:58+00:00","dateModified":"2018-07-31T12:06:01+00:00","mainEntityOfPage":{"@id":"https:\/\/codingislove.com\/test-driven-development-golang\/"},"wordCount":1065,"commentCount":3,"publisher":{"@id":"https:\/\/codingislove.com\/#organization"},"image":{"@id":"https:\/\/codingislove.com\/test-driven-development-golang\/#primaryimage"},"thumbnailUrl":"https:\/\/i.imgur.com\/VlAC4sQ.png","keywords":["Golang","software","Testing"],"articleSection":["Coding Tutorials","Quick tips for developers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codingislove.com\/test-driven-development-golang\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codingislove.com\/test-driven-development-golang\/","url":"https:\/\/codingislove.com\/test-driven-development-golang\/","name":"Test driven development with golang - Coding is Love","isPartOf":{"@id":"https:\/\/codingislove.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codingislove.com\/test-driven-development-golang\/#primaryimage"},"image":{"@id":"https:\/\/codingislove.com\/test-driven-development-golang\/#primaryimage"},"thumbnailUrl":"https:\/\/i.imgur.com\/VlAC4sQ.png","datePublished":"2018-07-31T12:01:58+00:00","dateModified":"2018-07-31T12:06:01+00:00","description":"This is an easy to understand practical guide about test-driven development in golang. The 3 laws of TDD introduced by bob martin is explained in simple words with examples.","breadcrumb":{"@id":"https:\/\/codingislove.com\/test-driven-development-golang\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codingislove.com\/test-driven-development-golang\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codingislove.com\/test-driven-development-golang\/#primaryimage","url":"https:\/\/i.imgur.com\/VlAC4sQ.png","contentUrl":"https:\/\/i.imgur.com\/VlAC4sQ.png"},{"@type":"BreadcrumbList","@id":"https:\/\/codingislove.com\/test-driven-development-golang\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Coding is Love","item":"https:\/\/codingislove.com\/"},{"@type":"ListItem","position":2,"name":"Coding Tutorials","item":"https:\/\/codingislove.com\/category\/tutorials\/"},{"@type":"ListItem","position":3,"name":"Test driven development with golang"}]},{"@type":"WebSite","@id":"https:\/\/codingislove.com\/#website","url":"https:\/\/codingislove.com\/","name":"Coding is Love","description":"","publisher":{"@id":"https:\/\/codingislove.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codingislove.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codingislove.com\/#organization","name":"Coding is Love","url":"https:\/\/codingislove.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codingislove.com\/#\/schema\/logo\/image\/","url":"https:\/\/codingislove.com\/wp-content\/uploads\/2015\/12\/codinglovenew.png","contentUrl":"https:\/\/codingislove.com\/wp-content\/uploads\/2015\/12\/codinglovenew.png","width":300,"height":225,"caption":"Coding is Love"},"image":{"@id":"https:\/\/codingislove.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/codingislove\/","https:\/\/x.com\/codingislove"]},{"@type":"Person","@id":"https:\/\/codingislove.com\/#\/schema\/person\/2170d4dd4bb588bc33fe87cab26d2738","name":"Arjun Mahishi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codingislove.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3a7d299055a500f67ec441d5106e96c83ee68f12f187320df06b65ac35c5951e?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3a7d299055a500f67ec441d5106e96c83ee68f12f187320df06b65ac35c5951e?s=96&d=wavatar&r=g","caption":"Arjun Mahishi"},"description":"Human by birth, machine by behaviour, geek by choice.","sameAs":["http:\/\/arjunmahishi.github.io"],"url":"https:\/\/codingislove.com\/author\/arjunmahishi\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/posts\/2808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/comments?post=2808"}],"version-history":[{"count":0,"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/posts\/2808\/revisions"}],"wp:attachment":[{"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/media?parent=2808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/categories?post=2808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codingislove.com\/wp-json\/wp\/v2\/tags?post=2808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}