mirror of
https://github.com/golang/go
synced 2024-11-18 10:14:45 -07:00
godoc: hide appengine dependencies behind build tags
Fixes the continuous build. Change-Id: If55b08c3b702ba705d84a30fdbce842438477883 Reviewed-on: https://go-review.googlesource.com/18241 Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
parent
2dff1e88eb
commit
a8498a77d5
@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build appengine
|
||||
|
||||
// Package dl implements a simple downloads frontend server.
|
||||
//
|
||||
// It accepts HTTP POST requests to create a new download metadata entity, and
|
||||
|
@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build appengine
|
||||
|
||||
package dl
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build appengine
|
||||
|
||||
package dl
|
||||
|
||||
// TODO(adg): refactor this to use the tools/godoc/static template.
|
||||
|
@ -1,13 +0,0 @@
|
||||
// Copyright 2015 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build appengine
|
||||
|
||||
package proxy
|
||||
|
||||
import "google.golang.org/appengine"
|
||||
|
||||
func init() {
|
||||
onAppengine = !appengine.IsDevAppServer()
|
||||
}
|
@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build appengine
|
||||
|
||||
// Package proxy proxies requests to the sandbox compiler service and the
|
||||
// playground share handler.
|
||||
// It is designed to run only on the instance of godoc that serves golang.org.
|
||||
@ -155,10 +157,8 @@ func share(w http.ResponseWriter, r *http.Request) {
|
||||
p.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
var onAppengine = false // will be overriden by appengine.go and appenginevm.go
|
||||
|
||||
func allowShare(r *http.Request) bool {
|
||||
if !onAppengine {
|
||||
if appengine.IsDevAppServer() {
|
||||
return true
|
||||
}
|
||||
switch r.Header.Get("X-AppEngine-Country") {
|
||||
|
@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build appengine
|
||||
|
||||
// Package short implements a simple URL shortener, serving an administrative
|
||||
// interface at /s and shortened urls from /s/key.
|
||||
// It is designed to run only on the instance of godoc that serves golang.org.
|
||||
|
@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build appengine
|
||||
|
||||
package short
|
||||
|
||||
const templateHTML = `
|
||||
|
Loading…
Reference in New Issue
Block a user