diff --git a/cmd/getgo/main_test.go b/cmd/getgo/main_test.go index 9da726e4..932a7397 100644 --- a/cmd/getgo/main_test.go +++ b/cmd/getgo/main_test.go @@ -31,6 +31,11 @@ func init() { // TestMain creates a getgo command for testing purposes and // deletes it after the tests have been run. func TestMain(m *testing.M) { + if os.Getenv("GOGET_INTEGRATION") == "" { + fmt.Fprintln(os.Stderr, "main_test: Skipping integration tests with GOGET_INTEGRATION unset") + return + } + args := []string{"build", "-tags", testbin, "-o", testbin + exeSuffix} out, err := exec.Command("go", args...).CombinedOutput() if err != nil { diff --git a/cmd/getgo/server/main.go b/cmd/getgo/server/main.go index 0bd33377..b5995065 100644 --- a/cmd/getgo/server/main.go +++ b/cmd/getgo/server/main.go @@ -4,15 +4,13 @@ // Command server serves get.golang.org, redirecting users to the appropriate // getgo installer based on the request path. -package main +package server import ( "fmt" "net/http" "strings" "time" - - "google.golang.org/appengine" ) const ( @@ -30,9 +28,8 @@ var stringMatch = map[string]string{ "Darwin": macInstaller, } -func main() { +func init() { http.HandleFunc("/", handler) - appengine.Main() } func handler(w http.ResponseWriter, r *http.Request) {