{"id":209,"date":"2026-04-13T09:00:00","date_gmt":"2026-04-13T03:30:00","guid":{"rendered":"https:\/\/smitabharat.com\/blog\/?p=209"},"modified":"2026-10-10T21:20:45","modified_gmt":"2026-10-10T15:50:45","slug":"go-generics-examples","status":"publish","type":"post","link":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/","title":{"rendered":"Go Generics Explained with Examples"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Go generics let you write one function or type that works with many data types, without copying code. In this post, you will learn type parameters, constraints and generic types, plus when to skip generics. Each idea comes with a short example that you can run yourself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generics build on two earlier ideas. First, constraints are interfaces, which you learned in <a href=\"https:\/\/smitabharat.com\/blog\/go-interfaces-examples\/\">interfaces in Go with examples<\/a>. Second, most generic code works on lists, so a refresher on <a href=\"https:\/\/smitabharat.com\/blog\/go-slices-arrays-explained\/\">slices and arrays in Go<\/a> will help.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Are Go Generics?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Generics arrived in Go 1.18. They let a function take a type as a parameter, just like it takes values. In other words, you write the logic once and Go fills in the real type when you call it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Think of a cookie cutter. The shape stays the same, but you can press it into chocolate dough or plain dough. Similarly, Go generics keep the logic fixed while the data type changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Problem Go Generics Solve<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>func MaxInt(a, b int) int {\n\tif a &gt; b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfmt.Println(MaxInt(3, 7)) \/\/ 7<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This works only for int. So for float64 or string, you would copy the same function again and again. Before generics, the other option was <code>any<\/code>, which loses type safety.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Writing Generic Functions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Type Parameters<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>func Max&#91;T cmp.Ordered](a, b T) T {\n\tif a &gt; b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfmt.Println(Max(3, 7))             \/\/ 7\nfmt.Println(Max(2.5, 1.5))         \/\/ 2.5\nfmt.Println(Max(\"apple\", \"mango\")) \/\/ mango<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The part in square brackets, <code>[T cmp.Ordered]<\/code>, is the type parameter list. Here <code>T<\/code> is a placeholder type, and <code>cmp.Ordered<\/code> limits it to types that support <code>&lt;<\/code> and <code>&gt;<\/code>. Then Go works out T from the arguments, which is called type inference.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-diagram-1024x640.png\" alt=\"Go Generics diagram showing one generic Max function used with int, float64 and string\" class=\"wp-image-211\" srcset=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-diagram-1024x640.png 1024w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-diagram-300x188.png 300w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-diagram-768x480.png 768w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-diagram-1536x960.png 1536w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-diagram-2048x1280.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><em>One generic Max function becomes a version for int, float64 or string, depending on the call.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Constraints: any and cmp.Ordered<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A constraint says which types are allowed. For example, <code>any<\/code> allows every type but permits few operations. In contrast, <code>comparable<\/code> allows <code>==<\/code>, and <code>cmp.Ordered<\/code> also allows ordering.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Custom Constraints with ~<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>type Number interface {\n\t~int | ~float64\n}\n\nfunc Sum&#91;T Number](nums &#91;]T) T {\n\tvar total T\n\tfor _, n := range nums {\n\t\ttotal += n\n\t}\n\treturn total\n}\n\nfmt.Println(Sum(&#91;]int{1, 2, 3}), Sum(&#91;]float64{1.5, 2.5})) \/\/ 6 4<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>|<\/code> sign means &#8220;or&#8221;, so Number allows int or float64. Also, the <code>~<\/code> sign includes your own types built on them, such as <code>type Rupees int<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Generic Types: A Stack Example<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>type Stack&#91;T any] struct {\n\titems &#91;]T\n}\n\nfunc (s *Stack&#91;T]) Push(v T) {\n\ts.items = append(s.items, v)\n}\n\nfunc (s *Stack&#91;T]) Pop() (T, bool) {\n\tvar zero T\n\tif len(s.items) == 0 {\n\t\treturn zero, false\n\t}\n\tv := s.items&#91;len(s.items)-1]\n\ts.items = s.items&#91;:len(s.items)-1]\n\treturn v, true\n}\n\nvar st Stack&#91;string]\nst.Push(\"a\")\nst.Push(\"b\")\nv, ok := st.Pop()\nfmt.Println(v, ok) \/\/ b true<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With Go generics, structs can have type parameters too. A stack works like a pile of plates, where the last plate you add is the first you take. Notice <code>var zero T<\/code>, which gives the zero value for whatever T turns out to be.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Go Generics in the Standard Library<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>fmt.Println(slices.Max(&#91;]int{4, 9, 2}))               \/\/ 9\nfmt.Println(slices.Contains(&#91;]string{\"a\", \"b\"}, \"b\")) \/\/ true<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>slices<\/code> and <code>maps<\/code> packages are full of ready-made generic helpers. So before you write your own, check whether the standard library already has one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When Not to Use Go Generics<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Generics add a little complexity, so use them only when they remove real duplication. If a function works with just one type, keep it plain. Likewise, if types share behaviour rather than data handling, a normal interface is often simpler.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes with Go Generics<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Error you see<\/th><th>Why it happens<\/th><th>How to fix it<\/th><\/tr><\/thead><tbody><tr><td>string does not satisfy Number (string missing in ~int | ~float64)<\/td><td>The type is not in the constraint.<\/td><td>Pass an allowed type or widen the constraint.<\/td><\/tr><tr><td>invalid operation: a &gt; b<\/td><td>The constraint is any, which has no &gt;.<\/td><td>Use cmp.Ordered.<\/td><\/tr><tr><td>syntax error: method must have no type parameters<\/td><td>A method declared its own type parameter.<\/td><td>Use a generic function instead.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The last rule surprises many people, because only types and functions can have type parameters. Generics now show up in interviews too, so try my <a href=\"https:\/\/smitabharat.com\/blog\/go-lang-interview-questions-and-answers\/\">Go interview questions and answers<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These pages come straight from the Go team, so they are always accurate and up to date.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/go.dev\/doc\/tutorial\/generics\">Tutorial: Getting started with generics<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/go.dev\/blog\/intro-generics\">Go blog: An Introduction To Generics<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pkg.go.dev\/slices\">slices package documentation<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go generics let one function or type work with many types.<\/li>\n\n\n\n<li>Type parameters go in square brackets, like [T cmp.Ordered].<\/li>\n\n\n\n<li>Constraints limit T, and ~int also allows types built on int.<\/li>\n\n\n\n<li>Structs like Stack[T] can be generic too.<\/li>\n\n\n\n<li>Check the slices and maps packages before writing your own helper.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Your code is getting powerful, so it needs proof that it works. Next, we will write automatic checks with Go&#8217;s built-in testing tools.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Coming soon: Go Unit Testing Explained for Beginners<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go generics let you write one function or type that works with many data types, without copying code. In this post, you will learn&hellip;<\/p>\n","protected":false},"author":1,"featured_media":210,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[15],"tags":[40,11,23,21],"swapz_series":[],"class_list":["post-209","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-go-lang","tag-go-generics","tag-go-lang","tag-go-tutorial","tag-golang-basics"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Go Generics Explained with Simple Examples<\/title>\n<meta name=\"description\" content=\"Learn Go generics with simple examples: type parameters, constraints like cmp.Ordered, custom constraints, a Stack type and common errors.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smitabharat.com\/blog\/go-generics-examples\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Go Generics Explained with Simple Examples\" \/>\n<meta property=\"og:description\" content=\"Learn Go generics with simple examples: type parameters, constraints like cmp.Ordered, custom constraints, a Stack type and common errors.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smitabharat.com\/blog\/go-generics-examples\/\" \/>\n<meta property=\"og:site_name\" content=\"Smita Bharat - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-04-13T03:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-10T15:50:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Smita\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Smita\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/\"},\"author\":{\"name\":\"Smita\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"headline\":\"Go Generics Explained with Examples\",\"datePublished\":\"2026-04-13T03:30:00+00:00\",\"dateModified\":\"2026-10-10T15:50:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/\"},\"wordCount\":656,\"publisher\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"image\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-generics-examples-featured.png\",\"keywords\":[\"Go Generics\",\"Go Lang\",\"Go Tutorial\",\"Golang Basics\"],\"articleSection\":[\"Go Lang\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/\",\"name\":\"Go Generics Explained with Simple Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-generics-examples-featured.png\",\"datePublished\":\"2026-04-13T03:30:00+00:00\",\"dateModified\":\"2026-10-10T15:50:45+00:00\",\"description\":\"Learn Go generics with simple examples: type parameters, constraints like cmp.Ordered, custom constraints, a Stack type and common errors.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/#primaryimage\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-generics-examples-featured.png\",\"contentUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-generics-examples-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Go Generics featured image: cards showing a type parameter, a constraint and a generic Stack\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-generics-examples\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Go Generics Explained with Examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/\",\"name\":\"Smita Bharat Blog\",\"description\":\"Golang &amp; Backend Development Tutorials and Interview Questions\",\"publisher\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"alternateName\":\"Smita Bharat\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\",\"name\":\"Smita\",\"logo\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/smitabharat.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Go Generics Explained with Simple Examples","description":"Learn Go generics with simple examples: type parameters, constraints like cmp.Ordered, custom constraints, a Stack type and common errors.","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:\/\/smitabharat.com\/blog\/go-generics-examples\/","og_locale":"en_US","og_type":"article","og_title":"Go Generics Explained with Simple Examples","og_description":"Learn Go generics with simple examples: type parameters, constraints like cmp.Ordered, custom constraints, a Stack type and common errors.","og_url":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/","og_site_name":"Smita Bharat - Blog","article_published_time":"2026-04-13T03:30:00+00:00","article_modified_time":"2026-10-10T15:50:45+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-featured.png","type":"image\/png"}],"author":"Smita","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Smita","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/#article","isPartOf":{"@id":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/"},"author":{"name":"Smita","@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"headline":"Go Generics Explained with Examples","datePublished":"2026-04-13T03:30:00+00:00","dateModified":"2026-10-10T15:50:45+00:00","mainEntityOfPage":{"@id":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/"},"wordCount":656,"publisher":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"image":{"@id":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-featured.png","keywords":["Go Generics","Go Lang","Go Tutorial","Golang Basics"],"articleSection":["Go Lang"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/","url":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/","name":"Go Generics Explained with Simple Examples","isPartOf":{"@id":"https:\/\/smitabharat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/#primaryimage"},"image":{"@id":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-featured.png","datePublished":"2026-04-13T03:30:00+00:00","dateModified":"2026-10-10T15:50:45+00:00","description":"Learn Go generics with simple examples: type parameters, constraints like cmp.Ordered, custom constraints, a Stack type and common errors.","breadcrumb":{"@id":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smitabharat.com\/blog\/go-generics-examples\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/#primaryimage","url":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-featured.png","contentUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-generics-examples-featured.png","width":2400,"height":1260,"caption":"Go Generics featured image: cards showing a type parameter, a constraint and a generic Stack"},{"@type":"BreadcrumbList","@id":"https:\/\/smitabharat.com\/blog\/go-generics-examples\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smitabharat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Go Generics Explained with Examples"}]},{"@type":"WebSite","@id":"https:\/\/smitabharat.com\/blog\/#website","url":"https:\/\/smitabharat.com\/blog\/","name":"Smita Bharat Blog","description":"Golang &amp; Backend Development Tutorials and Interview Questions","publisher":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"alternateName":"Smita Bharat","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smitabharat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339","name":"Smita","logo":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/smitabharat.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":1,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":212,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/209\/revisions\/212"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/media\/210"}],"wp:attachment":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/tags?post=209"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}