Step 1: Installation
You will first need to have the Google App Engine installed on the machine.
The App Engine SDK for Go can be downloaded from this link:
https://cloud.google.com/appengine/down ... SDK_for_Go
Step 2: To install the software just extract the contents of the Zip file downloaded from the link above.
It really does no matter where the SDK is installed, as it is a fully contained environment.
Lets assume the zip file is extracted to this drive location:
Code: Select all
c:\
Code: Select all
c:\go_appengine
The App Engine SDK has it's own version of Go so we need to setup the GOPATH and GOROOT variables and while where are at it, lets add the App Engine to the PATH environment variable as well.
There are several ways this could be done, but the easiest is to create a simple batch file.
Save the batch commands shown below to the c:\go_appengine\zae.cmd file and create a short cut to that file on the desktop.
Code: Select all
@echo off
rem Setup the Go App Engine environment
set PATH=c:\go_appengine\;%PATH%
set GOROOT=c:\go_appengine\goroot
set GOPATH=c:\go_appengine\gopath
rem Run a new instance of Zeus using those settings
start "" "C:\Program Files (x86)\Zeus\zeus.exe" -s
Step 4: Tell Gocode About the App Engine
The App Engine used the suffix option when it created its packages and that stops gocode from finding those packages.
For example depending on the CPU type, the App Engine will install package folders similar to these:
Code: Select all
c:\go_appengine\goroot\pkg\windows_386_appengine
c:\go_appengine\goroot\pkg\windows_amd64_appengine
Code: Select all
c:\go_appengine\goroot\pkg\windows_386
c:\go_appengine\goroot\pkg\windows_amd64
That is the setup complete. More details about using the App Engine can be found here:
https://cloud.google.com/appengine/docs ... ngstarted/
Note: goimports vs gofmt
Zeus is configured to run goimports on any file save action and in doing this test it was noted goimports can be a little slow when checking App engine code.
If this slowness becomes an issue it can be easily fixed by editing the Go document type and replacing the current goimports save trigger:
Code: Select all
$zud\zScript\go_imports.lua
Code: Select all
$zud\zScript\go_fmt.lua
To test the installation above start a new instance of Zeus using the shortcut created on the desktop.
Create a new MyApp folder at the following GOPATH folder location:
Code: Select all
c:\go_appengine\gopath\MyApp
Code: Select all
package guestbook
import (
"net/http"
"appengine"
)
func root(w http.ResponseWriter, r *http.Request) {
c := appengine.
}
