Beta Testers Wanted: SublimeText Go

Gophers,

We have a beta release of our new Go support packages that is now ready for early testing. Support comes in two packages: ‘golangconfig’ is a developer library used to obtain information about the local Go environment. It will handle configuration ($GOPATH, etc) through a combination of auto-detection and configuration. The end-user ‘Golang Build’ package provides Go toolchain integration with the Sublime build system - go build, go install, go test. It is the first package to utilize the functionality of golangconfig.

We would like our Sublime-using Gophers to test these new codebases by installing Golang Build. Currently the package is only available from a custom Package Control repository. To install it, please:

  1. Open the Sublime Text command palette and type “Add Repository”
  2. Paste https://packagecontrol.io/testing/go_packages.json into the input panel that opens
  3. Run the “Install Package” command via the command palette
  4. Type “Golang Build” and press enter

Once we have completed a few rounds of testing, the Golang Build package and golangconfig dependency will be added to the default Package Control channel and will be available to all users and package developers.

Documentation for the two packages is available on GitHub.

End-user documentation: https://github.com/golang/sublime-build/blob/master/docs/usage.md
Developer documentation: https://github.com/golang/sublime-config/tree/master/docs

Please file bugs using the appropriate issue trackers. For problems with Go environment detection and configuration, issues should be filed at:

For bugs related to the build command integration, issues should be filed at:

Our longer term goal is to have other Go-related Sublime packages ported to use golangconfig. This would allow users to set their Go environment configuration in one place and have that used by all of their installed Go/Sublime packages.

Happy Testing,
The Go Team

11 Likes

Thanks for making it!

Just wonder why not just use terminals…?

Most of the work went into the dependency - ‘golangconfig’. It provides a very nice framework for hierarchical environment configuration that can be used by all Go-related packages you have installed (were they to be ported to use this library):

  • Sublime global
  • OS specific
  • Project specific
  • Project + OS specific

If/when other packages are ported to use this library, users will also be able to set their Go environment once and have it used everywhere.

Part of the build system is actually a command to open a terminal to the Go environment you are working in. :smile: There can always be a reason to drop down to the terminal because of one-off flags, or something similar.

So based on that, you may ask what does this offer beyond just opening the terminal on my OS? Well, for convenience it adds a single keyboard shortcut to run your build or tests. However, it can also be useful due to the Sublime Text settings. Through Sublime Text project files and their settings, it is possible to have different Go workspaces for different projects, and easily run a build, tests, or open a terminal with all of the necessary environment variables set.

2 Likes

It looks like those links are transposed in the original post.

1 Like

This looks like a great start! I have installed the packages, tried them out, and filed a couple of issues. I will continue to explore.

Is there a way to go to the file and line number printed out in the output? like if it prints

api/unitassigner/unitassigner.go:36: cannot use result (type params.ErrorResults) as type []error in return argument

I want to click on that and hit a key to open that file at that line. I tried googling for an answer, but it’s kind of hard to describe to google.

Thanks for your answer! This is indeed very useful. :smiley:

I had the same question and filed this issue: Cannot navigate from build errors to source code location. · Issue #3 · golang/sublime-build · GitHub.

Doh! Now fixed.

Nate,

I completely agree - and came across the same UX problem myself (clicking on the text, hoping it would magically show me that file:line marker).

I’m not sure this is really a bug in the golang_build package. I assume some other package out there already implements this… I was just hoping someone knew which one.

What would make me want to use this package over the build integration with GoSublime?

1 Like

BTW, I’m trying this right now, and it’s amazing how much time I save by not having to switch windows to the terminal. I didn’t think it would be a big deal, but it really makes a difference, even without the goto line number.

FWIW I had used gosublime in the past, and it was always kind of wonky, so I basically stopped using it except for gofmt on save. This package seems to do exactly what I would want it to do.

1 Like

Our motivation for developing this is due to the apparent abandonment of the GoSublime project by the original author. The pull requests and issues are accumulating quickly on that codebase.

So we decided we wanted a simpler, composable infrastructure that would improve the experience for all Go-related Sublime packages. That is why the GolangBuild package is fairly simple in terms of features offered.

The GolangConfig package that GolandBuild is based on is designed to serve as a configuration building block for all Go packages. This will allow users to configure their Go environment (PATH, GOPATH, etc.) in one place, and have those settings used by multiple packages.

In theory, at least :wink:

3 Likes

I love the new go to line feature of the build output in the latest update. That alone will save me a ton of time every day.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.