Skip to content

Instantly share code, notes, and snippets.

@sinmetal
Created December 17, 2016 04:43
Show Gist options
  • Save sinmetal/a0d6874e7c885d15ab77d3dc2ee37863 to your computer and use it in GitHub Desktop.
Save sinmetal/a0d6874e7c885d15ab77d3dc2ee37863 to your computer and use it in GitHub Desktop.
package cpt
import (
"google.golang.org/appengine"
"golang.org/x/net/context"
)
// IsProduction is Production環境で動いていればtrueを返す
func IsProduction(c context.Context) bool {
appID := appengine.AppID(c)
return appID == "training-topgate"
}
// IsStaging is Staging環境で動いていればtrueを返す
func IsStaging(c context.Context) bool {
appID := appengine.AppID(c)
return appID == "training-topgate-dev"
}
// IsDevAppServer is DevAppServerで動いていればtrueを返す
func IsDevAppServer(c context.Context) bool {
return appengine.IsDevAppServer()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment