A TextMate bundle for the Go programming language.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



This repository is moving to github.com/AlanQuatermain/go-tmbundle

The code in this repository will not be updated from version 1.0. The new repository will have the bundle as its root folder, for easier installation.


(a TextMate language bundle)


The bundle here implements a language syntax, some snippets, and a 'Run' command for the Go language (golang.org).

At present there are still a couple of odd things to clear up. If anyone can suggest how to change the Run script to stop after any errors compiling or linking, and to not output empty blocks for those steps if all went well, I would be very grateful.



sets up an import statement with optional alternative name.


creates a function declaration with tab-stops for name, parameters, and return types.


creates a function as 'func' but adds the variable declaration needed to attach the function to a type (like a class method).


initializes a type declaration for you, with name and variable type as tab-stops.


lays out a structure declaration (use 'type' first to name your structure) with a tab stop on a sample member variable.


creates a plain 'main()' function for you.


lays out a standard for loop, with tab stops for count, variable name, and loop-end action.


lays out a plain if statement, with curly braces, tab stop on the condition. This is here because an if in Go MUST use braces it seems, and this is as good a way as any to force myself (and others) to remember that.

Compiling and Running

The Run() function will run 6g on your source file, then run 6l on the new <name>.6 file, then run the resulting 6.out file. All files will be created in the same folder as the source file. It doesn't do anything about building packages yet– that's something I'll add later on. In the meantime, to build a package archive (or append new .6 files to an existing package archive) you would use:

> 6g myfile.go
> gopack rg <archive>.a myfile.6 ...

+<archive>+ is the name for your archive file, and you can specify multiple .6 files to be appended to that archive. So for instance:

> 6g my_io.go my_file.go my_echo.go my_cat.go
> gopack rg my_stuff.a my_io.6 my_file.6 my_echo.6 my_cat.6

This creates or updates an output file named my_stuff.a.

Contact Information

You can contact me through github, or you can ping me on Twitter as 'alanQuatermain'.

Happy coding :)