Open wiless opened 9 years ago
WhenPrint methods from fmt are called during the init() For e.g in samples/helloworld/helloworld.go, the API Service discovery fails. http://localhost:8080/_ah/api/discovery/v1/apis returns
Print
fmt
samples/helloworld/helloworld.go
http://localhost:8080/_ah/api/discovery/v1/apis
{"error": {"message": "BackendService.getApiConfigs Error"}}
This also disables functionality of the api explorer http://localhost:8080/_ah/api/explorer
http://localhost:8080/_ah/api/explorer
init() from the helloworld.go
init()
helloworld.go
func init() { api, err := endpoints.RegisterService(&GreetingService{}, "greetings", "v1", "Greetings API", true) if err != nil { log.Fatalf("Register service: %v", err) } else { log.Printf("API registered %v", api) } endpoints.HandleHTTP() }
works but the following init() fails
func init() { api, err := endpoints.RegisterService(&GreetingService{}, "greetings", "v1", "Greetings API", true) if err != nil { log.Fatalf("Register service: %v", err) } else { fmt.Printf("API registered %v", api) } endpoints.HandleHTTP() }
When
Print
methods fromfmt
are called during the init() For e.g insamples/helloworld/helloworld.go
, the API Service discovery fails.http://localhost:8080/_ah/api/discovery/v1/apis
returnsThis also disables functionality of the api explorer
http://localhost:8080/_ah/api/explorer
init()
from thehelloworld.go
works but the following
init()
fails