Martin Probst's weblog

Go on App Engine and GoSublime (golang, code completion)

Monday, May 26, 2014, 19:54 — 0 comments Edit

I’m re-writing this blog using Go on App Engine, just for the fun. It took me quite a while to wrap my head around the available tool options, and get them set up correctly.

It turns out Sublime Text (my favorite text editor as of late) has a really nice plugin called GoSublime that provides various Go tools, including auto-completion through go code.

Sadly it also turns out that GoSublime is a bit fickle to get to work with App Engine’s Go libraries, possibly because of a bug. I think at this time, it’s not possible to have multiple Go workspaces with GoSublime that use different GOROOT paths (e.g. plain go + App Engine go).

But at least it’s possible to get consistent code completion and other GoSublime features working, with these global configuration settings in Preferences > Package Settings > GoSublime > Settings - User:

{
  "installsuffix": "appengine",
  "env": {
    // Your GOPATH for App Engine projects, e.g.
    "GOPATH": "/Users/martin/goae",
    // Your GOROOT, e.g.
    "GOROOT": "/usr/local/Cellar/go-app-engine-64/1.9.5/share/go-app-engine-64/goroot"
  },
  // ... any other settings you have ...
}

The source code running this puny blog is available at http://github.com/mprobst/blog by the way. It has zero features and is the first thing I ever wrote in Go, so probably not a good idea to take as an example for much.


No comments.