I wanted to send an email from my TraceLog package when a critical exception occurred. Fortunately Go’s standard library has a package called smpt which can be found inside the net package. When you look at the documentation you are left wanting.
I spent 20 minutes researching how to use this package. After fighting through the parameters and bugs, I came up with this sample code:
package main
import (
Continue readingI have been struggling with using the Time package that comes in the Go standard library. My struggles have come from two pieces of functionality. First, trying to capture the number of milliseconds between two different time periods. Second, comparing that duration in milliseconds against a pre-defined time span. It sounds like a no brainier but like I said, I have been struggling.
In the Time package there is a custom type called Duration and a set of helper constants:
Continue readingI am building my TraceLog package and it is really important that the package logs any internal exceptions and prevents panics from shutting down the application. The TraceLog package must never be responsible for shutting down an application. I also have internal go routines that must never terminate until the application is shut down gracefully.
Understanding how to use Defer and Recover in your application can be a bit tricky at first, especially if you are used to using try/catch blocks.
Continue readingAs you know if you read my blog, I have been building a set of new utility packages so I can start developing an application server I need for a new project. I am brand new to Go and the Mac OS. Needless to say it has been one hell of an education over the past month. But I don’t miss Windows or C# at all.
I made some progress in my coding and wanted to build documentation for the code.
Continue readingCheck out my new installtion document:
https://www.ardanlabs.com/blog/2016/05/installing-go-and-your-workspace.html
I removed the sections about gocode and GDB. These are not necessary any longer. I also added links for more editors.
Windows
This is a great post by Wade Wegner for installing Go on your Windows Machine:
http://www.wadewegner.com/2014/12/easy-go-programming-setup-for-windows/
Mac OS X
The following instructions will guide you through installing Go on your Mac. Step 1: Download Go Open your favorite browser and go to the following website:
Continue readingFor the past 20 years I have been writing server based and application software on the Microsoft stack. First in C/C++ leveraging the Win32 API and then in C# when .Net first was released. Over the past few months I have realized that trying to build scalable code on the Microsoft stack is becoming impossible. Why, Technology and Cost!!
Let's start with the licensing. Luckily I was accepted into the Bizspark program.
Continue readingAfter working in Go for some time now, I learned how to use an unbuffered channel to build a pool of goroutines. I like this implementation better than what is implemented in this post. That being said, this post still has value in what it describes.
https://github.com/goinggo/work
Introduction
In my world of server development thread pooling has been the key to building robust code on the Microsoft stack. Microsoft has failed in .
Continue reading