Adam.Blog()
Adam Presley's blog
Waiting For Goroutines to Finish Running Before Exiting
Image copyright Faizal Sugi Goroutines are primitives in Google’s Go language that allow a developer to easily write concurrent applications to make use of modern multi-core CPUs. Because these are baked into the language and super easy to use it becomes simple to make quick use of them in your...
Using A Middleware in Your Go Web Applications
Image copyright Ryan McGuire Middleware in Go HTTP applications is a way to chain HTTP handlers in a sequence to alter the request and response chain prior to your primary handler getting it. This is useful for activities such as logging, input sanitization, handling authorization and security, and more. This...
My First SVN Post-Commit Hook in Go - Part 2
Image copyright Ryan McGuire This is part two of the two part series on how I created a Subversion post-commit hook using Go, and post a message in a HipChat room. This post follows part one by talking about how to post the message to HipChat. I did this for...
My First SVN Post-Commit Hook in Go - Part 1
Image copyright Ryan McGuire This is part one of a two part series on how I created a Subversion post-commit hook using Go, and post a message in a HipChat room. I did this for the teams at my day job. Please note that certain pieces of code have been...
JavaScript Multiselect Widget, With No jQuery!
Last night I decided to write a multi-select JavaScript widget. I need such a widget to allow the users of a little app I am working on to select one or more items. I wanted it to look a little more pretty than the default <select> box and I also...
Response To Adam Cameron's Code Review
A few weeks ago I submitted a response to a code puzzle on Adam Cameron’s blog that I wrote using Go. He has (finally) submitted a review! First let me say that it is about time Mr. Cameron! I have waited with bated breath! That review can be read here....
Handling CTRL+C In Go Command Line Applications
Command line and server-style application often allow you to press a key combination, such as CTRL+C to gracefully exit. In Go this is a pretty easy task to accomplish, and in this entry I will show you how you can add this ability in your own applications.
Deploying My First Go Application to Heroku
For the last week or so I’ve been converting a site I manage from WordPress to a simple Go application. There are three reasons I want to do this. WordPress has been extreme overkill for what I actually need Performance. WordPress on a shared host is just not fast enough...
Returning an HTTP Server From a Function in Go
When building web applications in Go the most common example is one that sets up a handler for a specific URL route (endpoint) then fires up the HTTP server to listen for requests. It looks like this. package main import ( "net/http" "github.com/adampresley/myproject/controllers/versionController" ) func main() { http.HandleFunc("/", versionController.GetVersion) http.ListenAndServe("0.0.0.0:8080",...
No Weapon Formed Debut Album Coming Soon!
My brother and his band No Weapon Formed will be releasing their debut album soon. The title of the album undetermined still but you can find a preview track YouTube named Phoenix. Go check it out and give it a like. These guys certainly have a great rock sound!