{"id":1242,"date":"2013-11-01T02:15:32","date_gmt":"2013-11-01T08:15:32","guid":{"rendered":"http:\/\/bateru.com\/news\/?p=1242"},"modified":"2013-11-02T10:55:07","modified_gmt":"2013-11-02T16:55:07","slug":"social-network-in-30-days-day-8-day-10","status":"publish","type":"post","link":"https:\/\/bateru.com\/news\/2013\/11\/social-network-in-30-days-day-8-day-10\/","title":{"rendered":"Social Network in 30 days : Day 8 &#8211; Day 10"},"content":{"rendered":"<p>I haven&#8217;t had time to work on the site, <a href=\"http:\/\/linksteach.me\">LinksTeach.me<\/a>, for sometime now. So what I&#8217;m going to do is delay development for 3 days to finish up a few other side projects and complete essential training.<br \/>\nI&#8217;ll startup backup on monday and plan to release an alpha version on Nov 11, 2013.<\/p>\n<p>Awesome bash script:<br \/>\n<code><\/p>\n<pre lang=\"bash\">find . -name main.go | xargs -L1 sed -ri \"1s\/^\\\/\\\/.*[^\\.]$\/&\\.\/\"`<\/pre>\n<p><\/code><br \/>\nThe command finds all the files with the name main.go within the current directory.<br \/>\nAfter which, for each file it adds a dot to the end of the first line if it&#8217;s a comment and doesn&#8217;t need with a period.<br \/>\nWhy is this useful?<br \/>\n`godoc` is a tool for creating documentation for Google Go files.<br \/>\nExample:<br \/>\nSource code for <a href=\"http:\/\/golang.org\/src\/pkg\/errors\/errors.go?m=text\">errors<\/a><br \/>\nDocumentation for <a href=\"http:\/\/golang.org\/pkg\/errors\/\">errors<\/a><\/p>\n<p>`godoc` will use the first sentence as the description for a package. Since I didn&#8217;t end the first line with a period, then the entire comment on multiple lines becomes the description for the package.<\/p>\n<p>So when run the awesome bash command above, it corrects the package comment each main.go like so.<br \/>\nExample.<br \/>\n<code><\/p>\n<pre lang=\"golang\">\r\n\/\/ Example code for Chapter 2.3 from \"Build Web Application with Golang\"\r\n\/\/ Purpose: Creating a basic function\r\n<\/pre>\n<p><\/code><br \/>\nto this.<br \/>\n<code><\/p>\n<pre lang=\"golang\">\r\n\/\/ Example code for Chapter 2.3 from \"Build Web Application with Golang\".\r\n\/\/ Purpose: Creating a basic function\r\n<\/pre>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I haven&#8217;t had time to work on the site, LinksTeach.me, for sometime now. So what I&#8217;m going to do is delay development for 3 days to finish up a few other side projects and complete essential training. I&#8217;ll startup backup on monday and plan to release an alpha version on Nov 11, 2013. Awesome bash &hellip; <a href=\"https:\/\/bateru.com\/news\/2013\/11\/social-network-in-30-days-day-8-day-10\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Social Network in 30 days : Day 8 &#8211; Day 10<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[157],"tags":[],"class_list":["post-1242","post","type-post","status-publish","format-standard","hentry","category-sn_in_30_days"],"_links":{"self":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/1242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/comments?post=1242"}],"version-history":[{"count":4,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/1242\/revisions"}],"predecessor-version":[{"id":1244,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/1242\/revisions\/1244"}],"wp:attachment":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/media?parent=1242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/categories?post=1242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/tags?post=1242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}