Golang News http://golangnews.com Jobs, Code, Videos and News for Go hackers - everything about the go programming language Sun, 25 Mar 2018 19:39:00 +0000 Pitfalls of context values and how to avoid or mitigate them 13 points posted by kenny https://www.calhoun.io/pitfalls-of-context-values-and-how-to-avoid-or-mitigate-them 1688 Tue, 07 Feb 2017 21:35:00 +0000 Implementing binary search in Go #letslearnalgorithms 13 points posted by kenny http://www.calhoun.io/lets-learn-algorithms-implementing-binary-search 1276 Sun, 27 Nov 2016 14:25:00 +0000 How to use slice capacity and length in go #tutorials This blog post discusses a common bug stemming from developers not understanding append and make, and then goes into the difference between slices and arrays so that it is easier to understand what capacity and length are and how they are used when making slices. 12 points posted by jon https://www.calhoun.io/how-to-use-slice-capacity-and-length-in-go 1620 Wed, 25 Jan 2017 23:56:00 +0000 How to determine if a JSON key has been set to null or not provided in Go #json In this article we discuss how to differentiate between { "published_at": null } and a JSON payload that simply doesn't have the published_at key set at all. 10 points posted by jon https://www.calhoun.io/how-to-determine-if-a-json-key-has-been-set-to-null-or-not-provided 1741 Tue, 14 Feb 2017 23:40:00 +0000 Useful ways to use closures in go Explore five different real world use cases for closures that will help you understand and utilize closures better in your own code. 8 points posted by kenny http://www.calhoun.io/5-useful-ways-to-use-closures-in-go 1069 Tue, 13 Sep 2016 21:20:00 +0000 Securing cookies in go #web #cookies <header class="post-header" style="text-rendering: optimizeLegibility; box-sizing: border-box; color: rgb(51, 51, 51); font-family: 'Noto Serif', Georgia, Cambria, 'Times New Roman', Times, serif; font-size: 20px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);"><h1 itemprop="name headline" class="post-title"><a href="https://www.calhoun.io/securing-cookies-in-go/" itemprop="url" data-pjax="" title="Securing Cookies in Go" style="text-rendering: optimizeLegibility; box-sizing: border-box; color: rgb(51, 51, 51); transition: color 0.3s; background-position: 0px 0px; background-repeat: initial initial;">Securing Cookies in Go</a></h1></header><aside class="post-side" style="text-rendering: optimizeLegibility; box-sizing: border-box; position: fixed; top: 80px; left: 0px; width: 195px; padding: 0px 5px; text-align: right; z-index: 300; color: rgb(51, 51, 51); font-family: 'Noto Serif', Georgia, Cambria, 'Times New Roman', Times, serif; font-size: 20px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);"><div class="post-author"></div></aside><div itemprop="articleBody" class="post-body"> <p>When I first started learning Go I had experience with web development, but a little less experience working directly with cookies. I was coming from a Rails background, and while I had to read/write cookies in Rails, I didn't actually need to implement all of the security measures myself.</p></div> 7 points posted by andythomas https://www.calhoun.io/securing-cookies-in-go 2570 Wed, 23 Aug 2017 20:23:00 +0000 Why we import SQL drivers as the blank identifier ( _ ) in Go 7 points posted by drogo http://www.calhoun.io/why-we-import-packages-we-dont-actually-use-in-golang 1177 Fri, 28 Oct 2016 07:56:00 +0000 Inserting records into a postgresql database using sql 6 points posted by andythomas http://www.calhoun.io/inserting-records-into-a-postgresql-database-using-sql 1147 Wed, 19 Oct 2016 14:01:00 +0000 Using postgresql with Go 6 points posted by gopher http://www.calhoun.io/using-postgresql-with-golang/ 1133 Fri, 14 Oct 2016 11:04:00 +0000 Querying for a single record using Go's sql package #sql #data 5 points posted by gopher https://www.calhoun.io/querying-for-a-single-record-using-gos-database-sql-package 1938 Wed, 15 Mar 2017 20:24:00 +0000 Inserting records into a postgresql database with Go In this post we are going to take everything we have learned a step further and we are going to look at how to insert records into an SQL database, along with how the database/sql package helps us avoid any unwanted SQL injection attacks by cleaning the inputs we provide before executing SQL statements. Don't worry if you aren't familiar with SQL injection - we will be covering what it is and what exactly the database/sql package does to prevent it within this post. 5 points posted by gopher https://www.calhoun.io/inserting-records-into-a-postgresql-database-with-gos-database-sql-package 1524 Fri, 13 Jan 2017 11:04:00 +0000 Lets learn algorithms - an intro to bubble sort 5 points posted by gopher http://www.calhoun.io/lets-learn-algorithms-an-intro-to-bubble-sort 1155 Sat, 22 Oct 2016 10:32:00 +0000 An Intro to Templates in Go #web An article that introduces the html/template package in Go and reviews some of the context specific encoding that happens behind the scenes. This is part of a multi part series, and you can check out part 2 here: http://www.calhoun.io/http-www-calhoun-io-an-intro-to-templates-in-go-part-2/ 5 points posted by jon http://www.calhoun.io/an-intro-to-templates-in-go-part-1-of-3 1014 Thu, 25 Aug 2016 20:34:00 +0000 Using code generation to survive without generics in go If you have used Go (aka golang) for any amount of time, you have probably run into a situation where the language being both statically typed and not supporting generics has proven to be problematic. 4 points posted by lolly https://www.calhoun.io/using-code-generation-to-survive-without-generics-in-go 2191 Wed, 10 May 2017 16:52:00 +0000 Creating random strings in go #tutorial I've written a bit about generating random strings in the past, but I felt the topic might be worth its own post for people new to programming or Go. Any feedback is welcome :) 4 points posted by jon http://www.calhoun.io/creating-random-strings-in-go 1301 Sat, 03 Dec 2016 01:13:00 +0000 How to shuffle arrays and slices in go Learn how to write a shuffle function using the random package's Intn and Perm functions. 3 points posted by jon https://www.calhoun.io/how-to-shuffle-arrays-and-slices-in-go 1795 Thu, 23 Feb 2017 00:04:00 +0000 Why are slices sometimes altered when passed by value in go 3 points posted by drogo https://www.calhoun.io/why-are-slices-sometimes-altered-when-passed-by-value-in-go 1649 Tue, 31 Jan 2017 16:08:00 +0000 Wrapping packages to isolate code responsibility 3 points posted by jon https://www.calhoun.io/wrapping-packages-to-isolate-code-responsibility 1565 Thu, 19 Jan 2017 00:34:00 +0000