Michael R. Cook Ruby and Golang Developer

Category: Golang

TimeWarrior 1.0.0 - A golang time tracker

After barely programming in Go these past two years I really wanted to get back into using the language, and figured a good starter project would be to port my Ruby time tracker to Go. So a few weeks back I started rewriting that old CLI application in Go, and have now released TimeWarrior 1.1.0 on Github.

TimeWarrior is a CLI based time tracking application used to record timeslips for your freelance and personal projects. Timeslips for a project are stored in their own project data files, with each timeslip saved as a valid JSON string.

Project and Task names are given as CamelCase; separated by a period. You would start a new timeslip like this:

$ tw s MyProject.SomeTask

You can pause and resume a timeslip at any time (the p and r shortcuts are available), and once work on a task is complete, you can mark it as done:

$ tw d "Some nice description of the work"

It’s also possible to adjust the time you’ve currently worked on a pending timeslip with the adjust command:

$ tw adjust 10m

I recommend you visit the Github repository which has full installation and usage instructions.

At the moment you will need to build the executable yourself, but hopefully I’ll have ready-made downloads for Windows and macOS soon, once I’ve run some tests on a Windows machine!

Please note that there’s currently no reporting functionality. I have a simple old script for my own needs, which I’ll eventually look into adding to the app.

If you’re impatient and you’d like to implement a report command yourself, please feel free to submit a PR!


How to Install Go ncurses on Mac OS X

If you’ve been trying to use the goncurses library in your Go project, but kept encountering various ncurses related errors - such as missing .pc files (ncurses.pc, form.pc, menu.pc, panel.pc) - then this post may help you get your Mac OS X, ncurses and golang installation running smoothly.

A couple of weekends ago I decided that porting the classic UMoria game could teach me alot about Go. It all went swimmingly well - if somewhat boring at times - and finally last night I was able to get the code to compile without errors, Woot! But when trying to install goncurses I kept getting ncurses errors. Boo!

I’d experimented a little with goncurses a couple of months back and somehow go it working - for the life of me I don’t now remember how. It was fun making my little @ character run around the screen, but when I updated to Go 1.5, I’d reset my golang dev environment, which included deleting old sources.

After several hours down the rabbit hole, I finally figured out what the issue was, and as I’m sure others have encountered these same problems, I wanted to share the solution here.


About Me

Hi, my name is Michael and this is my personal blog. Here I’ll be posting various coding thoughts and experiments; everything from writing blogs in Ruby, to Go tools and Z80 Assembly. This site is powered by Thunderaxe, a blogging platform I built using the Roda Ruby framework.