ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Go Build

by cthackers ST2

A plugin for Sublime Text 2 to help manage and build a GO project

Labels go

Details

  • 2012.09.17.12.50.52
  • github.​com
  • github.​com
  • 6 years ago
  • 52 minutes ago
  • 6 years ago

Installs

  • Total 16K
  • Win 10K
  • OS X 4K
  • Linux 2K
Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6
Windows 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 1 0 1 0 1 1 0 2 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 1 1
OS X 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 2 0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 0 2 0 0 1 0 0 1 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Go Build

Sublime Go Build is a plugin for Sublime Text 2 that will help you create a Go project structure, and run/build/test your project from withing the editor.

How to install

Install using Sublime Package Control (recommended)
Sublime Package Control allows you to easily install or remove SublimeGoBuild(and many other ST2 packages) from within the editor. It offers automatically updating packages as well so you no longer need to keep track of changes in SublimeGoBuild.

  1. Install Sublime Package Control (if you haven't done so already) from http://wbond.net/sublime_packages/package_control . Be sure to restart ST2 to complete the installation.

  2. Bring up the command palette (default ctrl+shift+p or cmd+shift+p) and start typing Package Control: Install Package then press return or click on that option to activate it. You will be presented with a new Quick Panel with the list of available packages. Type Go Build and press return or on its entry to install SublimeGoBuild. If there is no entry for SublimeGoBuild, you most likely already have it installed.

Manual Instalation
Download the package

* For Windows:
Go to %APPDATA%\Sublime Text 2\Packages and extract the archive in a new folder
* For Linux:
Go to ~/.config/Sublime Text 2/Packages and extract the archive in a new folder

Install using git
* For Windows:
Open a cmd, go to %APPDATA%\Sublime Text 2\Packages and type…
* For Linux:
Open a shell, go to ~/.config/Sublime Text 2/Packages and type…

git clone git://github.com/cthackers/SublimeGoBuild.git

How To use

Create and save a new Sublime Text project, then from the Project menu bar select Create GO Project. It will ask you to give the project a name. This name will be used as your executable output name. If your project doesn't have the usual structure it will be created. All code should go in the src folder

You can edit the project file (.sublime-project) and add a new key at the settings called main

"settings": {
        "go_project": true, 
        "name": "HelloW",
        "main" : "src/main.go"
    }

If the project file contains the main setting, then wherever you are in a project, pressing F5 or F7 will run or build the main file indicated by the setting

Use:
* F5 to run your project
* F7 to build
* CTRL + F5 to run tests

You don't need to worry about setting the GOPATH variable. It will be automaticall set based on the project of which the file you're editing belongs to.