Closed cantrellryan closed 4 years ago
There are a few other changes needed for deploying with Go 1.12+, such as the required "main" package (unable to deploy without "package main") and changes in dependency management. See [1]. A rewrite of at least part of the application will likely be needed.
[1] https://cloud.google.com/appengine/docs/standard/go/go-differences
Yeah, saw that and was able to get past that by renaming the package. But the next steps were beyond my skillset unfortunately.
I have added main.go
as suggested in https://cloud.google.com/appengine/docs/standard/go/go-differences#migrating-appengine-sdk. But now with gcolud app deploy
it shows the root of you app needs to be package "main" (currently "beacon")
.
@aravind-j
in your go file, you need to add package main
also, add this method after init
func main() {
http.HandleFunc("/", indexHandler)
port := os.Getenv("PORT")
if port == "" {
port = "8080"
log.Printf("Defaulting to port %s", port)
}
log.Printf("Listening on port %s", port)
if err := http.ListenAndServe(":"+port, nil); err != nil {
log.Fatal(err)
}
}
but it is failing on appengine import I have no idea how to fix that
@igrigorik I know you are busy. Do you mind adding new deployment instructions
We've been running this app for the last couple of years with great success. I saw the recent updates to the project to support running on Go 1.12+ but am unable to to deploy it successfully.
After doing some digging it appears that the issue is that the package "appengine" is deprecated with Go 1.12. Is there a way to deploy with 1.12 or 1.13 or does that require a re-write of the main app?