Go Story
By: Jay Poss
Tags: Golang, Digitalocean, Smartsheet, API, Mongodb

I like coding. Go is my favorite language. Javascript is fun, Python is nice, Java sucks (IMO), and Cobol is really different (I’m an old guy).

For the past 3 years my job has been to “run” software development for a small company. I’ve written several web apps (client and server side) and many batch processes. Except for the client side browser code, everything is written in Go. Our primary database is MongoDB and we use MySql for most reporting. We have automated interfaces with all our clients and our bank. DigitalOcean is our platform provider.

I originally put our systems on Rackspace. I didn’t have much server setup experience so I wanted the hand holding. They did provide more direct support than DigitalOcean, but I eventually decided they weren’t worth the money. I next considered Google Cloud. At first I was excited with all the cool features. I tried following their recommended setup procedures and got frustrated. I announced to the team we were moving to Google Cloud and began the process, thinking everything would eventually come together. At some point I got mad (maybe because of my own stupidity) and called off the move to Google.

We have been running on DigitalOcean a little over 1 year. The setup process and features provided are fantastic. There was 1 issue with the block storage (Volumes) initialization. Support just referred me to a reference document which I didn’t understand very well, but I got it figured out. I am going to jinx things, but so far no problems.

MongoDB is an interesting product. In some ways it’s great. In other ways not so much. On the whole it has been a good choice. Early on we were adding and changing things like mad. MongoDB is so flexible and I like combining related data on the same document. It’s not so great for reporting which is why we import the Mongo data into MySql for reporting. Writing a sql statement is much easier than building an aggregation pipeline.

Most programs use the MGO driver which is great, but is no longer in development. New programs use the official Mongo driver from MongoDB. To simplify working with the new driver I put together a package called Mog. It has similarities to MGO, but is just a small set of tools for interacting with the Mongo driver. Warning, after I put Mog on Github, I got ambitious and added a bunch of new features that haven’t been used in production processes yet.

I recently started pushing our company to make better use of available 3rd party web applications. We got a few licenses for Monday.com and I wrote a set of api functions in Go that make it easy to upload/download items with Monday. Their api is graphql based which is really different.

Continuing in the same direction, I dug into using Smartsheet as a replacement for some of our custom web apps. I put together a pretty powerful Smarsheet “mini” SDK for Go. At this point we haven’t moved any apps to Smartsheet, but it is still an area of interest.

I also created a set of Go api functions that make it easy to work with the Egnyte data storage service. This service with the api interface and desktop app provides a great way to give users access to files created by production processes running on the Linux server.

So far Go is not treated as a first class language when using these various api’s. Smartsheet is very popular and been around a long time yet there were virtually no packages or examples of how to use Go with the Smartsheet api. When I look at examples in other languages, particularly Java and C#, my response is WTF. That is some ugly code, why are you guys not doing more with Go !

Nothing is perfect so here’s a couple nitpicks. Using the empty interface, “interface{}” to represent any type is weird. I get it, but for someone coming from another language they probably do a little head scratching figuring that one out. The term slice means a part of something (noun) or to cut something (verb). Python has lists, which just seems a more intuitive name. I know the guys that came up with these terms had good reason and are much smarter than me, but I’m just saying.

Guess this rambling has gone long enough.