Going Go Programming Recent Posts
Using The Log Package In GoLinux is unique to Windows in many ways, and writing programs in Linux is no exception. The use of standard out, standard err and null devices is not only a good idea but it’s the law. If your programs are going to be logging information, it is best to follow the destination conventions. This way your programs will work with all of the Mac/Linux tooling and hosted environments. Go has a package in the standard library called log and a type called logger.
Using XSLT With GoI am working on a project that requires pulling and processing different XML feeds from the web and storing the data into MongoDB as JSON. Since new feeds come up everyday, changing the Go program to process and publish new feeds is out of the question. A second constraint is that processing has to work in Iron.io or any other linux cloud based environment. What I needed was a Go program that could take an XML document and XSLT stylesheet at runtime, transform the XML into JSON and then store the JSON to MongoDB.
Manage Dependencies With GODEPIntroduction If you are using 3rd party packages, (packages that you don’t own or control), you will want a way to create a reproducible build every time you build your projects. If you use 3rd party packages directly and the package authors change things, your projects could break. Even if things don’t break, code changes could create inconsistent behavior and bugs. Keith Rarick’s tool godep is a great step in the right direction for managing 3rd party dependencies and creating reproducible builds.
Cross Compile Your Go ProgramsIntroduction In my post about building and running programs in Iron.Io, I needed to switched over to my Ubuntu VM to build linux versions of my test programs locally. I love the ability to have Ubuntu available to me for building and testing my code. However, if I can stay on the Mac side it is better. I have wanted to learn how to cross compile my Go programs for the two platforms I use, darwin/amd64 and linux/amd64.
Go Package Management Call To Action
Nathan Youngman, with the help of others, has produced this document outlining months of research and discovery. I would appreciate everyone to honestly read it before continuing with my post.