{"id":723,"date":"2022-11-29T10:08:28","date_gmt":"2022-11-29T09:08:28","guid":{"rendered":"https:\/\/go-tutorial.com\/?p=723"},"modified":"2023-07-14T14:41:06","modified_gmt":"2023-07-14T12:41:06","slug":"go-for-loop","status":"publish","type":"post","link":"https:\/\/go-tutorial.com\/go-for-loop","title":{"rendered":"Go For Loop: One Loop To Rule Them All"},"content":{"rendered":"\n<p>Loops are an important concept in programming, and Go has several options for looping through code. Unlike other programming languages, Go only has one keyword to create a loop: <code>for<\/code>.<\/p>\n\n\n\n<p>That doesn&#8217;t mean Go has just one type of loop, though. In this article, we&#8217;ll explore four ways of looping in Go: <code>for<\/code> loops, <code>while<\/code> loops, infinite loops, and looping over a range.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"the-syntax-of-a-go-for-loop\">The syntax of a Go for loop<\/h2>\n\n\n<p>One type of loop in Go is the <code>for<\/code> loop. It closely resembles the traditional for-loop that those with experience in C-like languages will know. It has three parts: <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>the init statement, <\/li>\n\n\n\n<li>the condition, <\/li>\n\n\n\n<li>and the post statement.<\/li>\n<\/ol>\n\n\n\n<p>The init statement runs at the beginning of the loop, the condition is checked before each iteration, and the post statement runs at the end of each iteration. Here&#8217;s an example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Go\" data-shcb-language-slug=\"go\"><span><code class=\"hljs language-go\"><span class=\"hljs-keyword\">for<\/span> i := <span class=\"hljs-number\">0<\/span>; i &lt; <span class=\"hljs-number\">5<\/span>; i++ {\r\n    fmt.Println(i)\r\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Go<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">go<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This loop will print out the numbers 0 through 4. <\/p>\n\n\n\n<p>Did you recognize the three parts?<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The <a href=\"https:\/\/go-tutorial.com\/go-variables\">variable<\/a> <code>i<\/code> is initialized to 0 in the init statement<\/li>\n\n\n\n<li>The loop continues as long as <code>i<\/code> is less than 5 (the condition)<\/li>\n\n\n\n<li>At the end of each iteration, <code>i<\/code> is incremented by 1 using the post statement <code>i++<\/code>.<\/li>\n<\/ol>\n\n\n<h2 class=\"wp-block-heading\" id=\"a-go-while-loop\">A Go While Loop<\/h2>\n\n\n<p>Another type of loop in Go is the <code>while<\/code> loop, which only has a condition checked at the beginning of each iteration. If the condition is true, the loop continues; if it is false, it ends. Let&#8217;s see how we can create the equivalent of a while loop using <code>for<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Go\" data-shcb-language-slug=\"go\"><span><code class=\"hljs language-go\">x := <span class=\"hljs-number\">0<\/span>\r\n<span class=\"hljs-keyword\">for<\/span> x &lt; <span class=\"hljs-number\">5<\/span> {\r\n    fmt.Println(x)\r\n    x++\r\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Go<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">go<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This loop will also print out the numbers 0 through 4. The variable <code>x<\/code> is initialized to 0 before the loop, and the loop continues as long as <code>x<\/code> is less than 5. At the end of each iteration, <code>x<\/code> is incremented by 1.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"infinite-loop\">Infinite loop<\/h2>\n\n\n<p>To create an infinite loop in Go, use for without anything else:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Go\" data-shcb-language-slug=\"go\"><span><code class=\"hljs language-go\"><span class=\"hljs-keyword\">for<\/span> {\r\n  ....\r\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Go<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">go<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>You&#8217;ll have to break out of the loop yourself, e.g. when some condition is met. To do so, you can use either:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>break<\/code>: a statement created to break out of loops immediately<\/li>\n\n\n\n<li><code>return<\/code>, which returns from the function this loop is currently running in<\/li>\n\n\n\n<li><code>goto<\/code>, which jumps to a labeled section of code.<\/li>\n<\/ol>\n\n\n<h2 class=\"wp-block-heading\" id=\"go-range-loops\">Go range loops<\/h2>\n\n\n<p>Finally, there&#8217;s also a <code>range<\/code> form of the <code>for<\/code> loop in Go, which iterates over a slice or map. Here&#8217;s an example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Go\" data-shcb-language-slug=\"go\"><span><code class=\"hljs language-go\">numbers := &#91;]<span class=\"hljs-keyword\">int<\/span>{<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">5<\/span>}\r\n<span class=\"hljs-keyword\">for<\/span> i, number := <span class=\"hljs-keyword\">range<\/span> numbers {\r\n    fmt.Println(i, number)\r\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Go<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">go<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This loop will print out the index and value of each element in the <code>numbers<\/code> slice. The variable <code>i<\/code> is the current element&#8217;s index, and <code>number<\/code> is the value of the element.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"learn-more\">Learn more<\/h2>\n\n\n<p>Here are some more resources to learn about loops:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Go documentation has a section on loops that provides more information and examples: <a href=\"https:\/\/tour.golang.org\/flowcontrol\/1\">https:\/\/tour.golang.org\/flowcontrol\/1<\/a><\/li>\n\n\n\n<li>The Go by Example website has several examples of different types of loops in Go: <a href=\"https:\/\/gobyexample.com\/looping\">https:\/\/gobyexample.com\/looping<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Loops are an important concept in programming, and Go has several options for looping through code. Unlike other programming languages, Go only has one keyword to create a loop: for. That doesn&#8217;t mean Go has just one type of loop, though. In this article, we&#8217;ll explore four ways of looping in Go: for loops, while &#8230; <a title=\"Go For Loop: One Loop To Rule Them All\" class=\"read-more\" href=\"https:\/\/go-tutorial.com\/go-for-loop\" aria-label=\"Read more about Go For Loop: One Loop To Rule Them All\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":748,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[14],"tags":[15,16,18,17],"class_list":["post-723","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial","tag-beginner","tag-for","tag-loop","tag-while","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Go For Loop: One Loop To Rule Them All - tutorial<\/title>\n<meta name=\"description\" content=\"Learn everything about the Go for loop. Go has several options for looping through code, but all with just one statement: for.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/go-tutorial.com\/go-for-loop\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Go For Loop: One Loop To Rule Them All - tutorial\" \/>\n<meta property=\"og:description\" content=\"Learn everything about the Go for loop. Go has several options for looping through code, but all with just one statement: for.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/go-tutorial.com\/go-for-loop\" \/>\n<meta property=\"og:site_name\" content=\"tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-29T09:08:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-14T12:41:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/go-tutorial.com\/wp-content\/uploads\/2022\/11\/globe.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Erik\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@erikyan\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop\"},\"author\":{\"name\":\"Erik\",\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/#\\\/schema\\\/person\\\/d193ef480bd89853a4ed5108617e44b2\"},\"headline\":\"Go For Loop: One Loop To Rule Them All\",\"datePublished\":\"2022-11-29T09:08:28+00:00\",\"dateModified\":\"2023-07-14T12:41:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop\"},\"wordCount\":453,\"publisher\":{\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/go-tutorial.com\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/globe.jpg\",\"keywords\":[\"beginner\",\"for\",\"loop\",\"while\"],\"articleSection\":[\"Go Tutorial\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop\",\"url\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop\",\"name\":\"Go For Loop: One Loop To Rule Them All - tutorial\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/go-tutorial.com\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/globe.jpg\",\"datePublished\":\"2022-11-29T09:08:28+00:00\",\"dateModified\":\"2023-07-14T12:41:06+00:00\",\"description\":\"Learn everything about the Go for loop. Go has several options for looping through code, but all with just one statement: for.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop#primaryimage\",\"url\":\"https:\\\/\\\/go-tutorial.com\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/globe.jpg\",\"contentUrl\":\"https:\\\/\\\/go-tutorial.com\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/globe.jpg\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/go-for-loop#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/go-tutorial.com\\\/for-beginners\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Go Tutorial\",\"item\":\"https:\\\/\\\/go-tutorial.com\\\/tutorial\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Go For Loop: One Loop To Rule Them All\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/#website\",\"url\":\"https:\\\/\\\/go-tutorial.com\\\/\",\"name\":\"tutorial\",\"description\":\"Improve your Go programming skills\",\"publisher\":{\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/go-tutorial.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/#organization\",\"name\":\"tutorial\",\"url\":\"https:\\\/\\\/go-tutorial.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/go-tutorial.com\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/Go-Logo_Blue.svg\",\"contentUrl\":\"https:\\\/\\\/go-tutorial.com\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/Go-Logo_Blue.svg\",\"caption\":\"tutorial\"},\"image\":{\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/go-tutorial.com\\\/#\\\/schema\\\/person\\\/d193ef480bd89853a4ed5108617e44b2\",\"name\":\"Erik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8aafde648a2392ac69a0f79db75935e8f4dfa1c98af9cbd56416483631927b91?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8aafde648a2392ac69a0f79db75935e8f4dfa1c98af9cbd56416483631927b91?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8aafde648a2392ac69a0f79db75935e8f4dfa1c98af9cbd56416483631927b91?s=96&d=mm&r=g\",\"caption\":\"Erik\"},\"description\":\"Erik is a professional software engineer. He has written many tutorial for Go and Python programmers.\",\"sameAs\":[\"https:\\\/\\\/python.land\\\/\",\"https:\\\/\\\/x.com\\\/erikyan\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Go For Loop: One Loop To Rule Them All - tutorial","description":"Learn everything about the Go for loop. Go has several options for looping through code, but all with just one statement: for.","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:\/\/go-tutorial.com\/go-for-loop","og_locale":"en_US","og_type":"article","og_title":"Go For Loop: One Loop To Rule Them All - tutorial","og_description":"Learn everything about the Go for loop. Go has several options for looping through code, but all with just one statement: for.","og_url":"https:\/\/go-tutorial.com\/go-for-loop","og_site_name":"tutorial","article_published_time":"2022-11-29T09:08:28+00:00","article_modified_time":"2023-07-14T12:41:06+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/go-tutorial.com\/wp-content\/uploads\/2022\/11\/globe.jpg","type":"image\/jpeg"}],"author":"Erik","twitter_card":"summary_large_image","twitter_creator":"@erikyan","twitter_misc":{"Written by":"Erik","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/go-tutorial.com\/go-for-loop#article","isPartOf":{"@id":"https:\/\/go-tutorial.com\/go-for-loop"},"author":{"name":"Erik","@id":"https:\/\/go-tutorial.com\/#\/schema\/person\/d193ef480bd89853a4ed5108617e44b2"},"headline":"Go For Loop: One Loop To Rule Them All","datePublished":"2022-11-29T09:08:28+00:00","dateModified":"2023-07-14T12:41:06+00:00","mainEntityOfPage":{"@id":"https:\/\/go-tutorial.com\/go-for-loop"},"wordCount":453,"publisher":{"@id":"https:\/\/go-tutorial.com\/#organization"},"image":{"@id":"https:\/\/go-tutorial.com\/go-for-loop#primaryimage"},"thumbnailUrl":"https:\/\/go-tutorial.com\/wp-content\/uploads\/2022\/11\/globe.jpg","keywords":["beginner","for","loop","while"],"articleSection":["Go Tutorial"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/go-tutorial.com\/go-for-loop","url":"https:\/\/go-tutorial.com\/go-for-loop","name":"Go For Loop: One Loop To Rule Them All - tutorial","isPartOf":{"@id":"https:\/\/go-tutorial.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/go-tutorial.com\/go-for-loop#primaryimage"},"image":{"@id":"https:\/\/go-tutorial.com\/go-for-loop#primaryimage"},"thumbnailUrl":"https:\/\/go-tutorial.com\/wp-content\/uploads\/2022\/11\/globe.jpg","datePublished":"2022-11-29T09:08:28+00:00","dateModified":"2023-07-14T12:41:06+00:00","description":"Learn everything about the Go for loop. Go has several options for looping through code, but all with just one statement: for.","breadcrumb":{"@id":"https:\/\/go-tutorial.com\/go-for-loop#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/go-tutorial.com\/go-for-loop"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/go-tutorial.com\/go-for-loop#primaryimage","url":"https:\/\/go-tutorial.com\/wp-content\/uploads\/2022\/11\/globe.jpg","contentUrl":"https:\/\/go-tutorial.com\/wp-content\/uploads\/2022\/11\/globe.jpg","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/go-tutorial.com\/go-for-loop#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/go-tutorial.com\/for-beginners"},{"@type":"ListItem","position":2,"name":"Go Tutorial","item":"https:\/\/go-tutorial.com\/tutorial"},{"@type":"ListItem","position":3,"name":"Go For Loop: One Loop To Rule Them All"}]},{"@type":"WebSite","@id":"https:\/\/go-tutorial.com\/#website","url":"https:\/\/go-tutorial.com\/","name":"tutorial","description":"Improve your Go programming skills","publisher":{"@id":"https:\/\/go-tutorial.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/go-tutorial.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/go-tutorial.com\/#organization","name":"tutorial","url":"https:\/\/go-tutorial.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/go-tutorial.com\/#\/schema\/logo\/image\/","url":"https:\/\/go-tutorial.com\/wp-content\/uploads\/2022\/11\/Go-Logo_Blue.svg","contentUrl":"https:\/\/go-tutorial.com\/wp-content\/uploads\/2022\/11\/Go-Logo_Blue.svg","caption":"tutorial"},"image":{"@id":"https:\/\/go-tutorial.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/go-tutorial.com\/#\/schema\/person\/d193ef480bd89853a4ed5108617e44b2","name":"Erik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8aafde648a2392ac69a0f79db75935e8f4dfa1c98af9cbd56416483631927b91?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8aafde648a2392ac69a0f79db75935e8f4dfa1c98af9cbd56416483631927b91?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8aafde648a2392ac69a0f79db75935e8f4dfa1c98af9cbd56416483631927b91?s=96&d=mm&r=g","caption":"Erik"},"description":"Erik is a professional software engineer. He has written many tutorial for Go and Python programmers.","sameAs":["https:\/\/python.land\/","https:\/\/x.com\/erikyan"]}]}},"_links":{"self":[{"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/posts\/723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/comments?post=723"}],"version-history":[{"count":8,"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/posts\/723\/revisions"}],"predecessor-version":[{"id":29668,"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/posts\/723\/revisions\/29668"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/media\/748"}],"wp:attachment":[{"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/media?parent=723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/categories?post=723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/go-tutorial.com\/wp-json\/wp\/v2\/tags?post=723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}