ascent.io

random musings and unkept thoughts

Run Fmt Upon Save in Vim

| Comments

I’ve been working with Go for a few weeks now and thought I had vim set up to format my code using Fmt every time I saved. I did and I didn’t.

You see, we are working on the authorization piece of Ottemo and since many projects can benefit from the work we are doing, we wanted to submit our OAUTH2 work to the Martini project.

And, as should be, the source code needed to be formatted according to Golang standards.

The one liner, which will format your code is below:

.vimrc
1
2
" format golang upon save
autocmd FileType go autocmd BufWritePre <buffer> Fmt

My Personal Bash Prompt

| Comments

I like to have my prompt tell me several things: current directory, who I am logged in as, current git branch and language specific context. Recently, I’ve been jumping between ruby, python, node and golang as we decide upon the primary engine for Ottemo. It has been an interesting process as we want Ottemo to be rock-solid and secure as well as super easy to setup and of course, blindingly fast.

Debugging a Homebrew Failed Install

| Comments

This morning I wanted to install a Go environment on my Mac Air, only to be greeted with this ominous error from homebrew:

1
2
3
4
5
6
7
8
9
10
11
12
$ brew install bzr
==> Downloading https://launchpad.net/bzr/2.6/2.6.0/+download/bzr-2.6.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/bazaar-2.6.0.tar.gz
==> make man1/bzr.1
==> make
Cannot build extension "bzrlib._annotator_pyx".
Use "build_ext --allow-python-fallback" to use slower python implementations instead.

error: command 'clang' failed with exit status 1
make: *** [extensions] Error 1

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting

Using Gvm With Golang in Your Development Workflow

| Comments

Recently I began work on a project using golang, and it quickly became apparent I needed a way to map a Go environment to each project to manage dependencies. I wasn’t able to find everything I needed in a single location which became the genesis for this post. I try to follow this pattern set by the golang team at Google.