Git Product home page Git Product logo

old-go-tmbundle's Introduction

IMPORTANT:

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)

Features

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.

Snippets

imp

sets up an import statement with optional alternative name.

func

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

tfunc

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

type

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

struct

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

main

creates a plain ‘main()’ function for you.

for

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

if

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 :)

old-go-tmbundle's People

Contributors

alanquatermain avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.