Google App Engine - Read JSON file from application code

29 views
Skip to first unread message

Lawton Mizell

unread,
Oct 20, 2020, 10:28:39 PM10/20/20
to Google App Engine

Sergio Llopis

unread,
Oct 21, 2020, 12:05:58 PM10/21/20
to Google App Engine
Hello, 

I understand that you are trying to read a JSON file from a Go application that is hosted on App Engine.

The error message [1] that you are seeing can be due mainly to two reasons:

1 - The file does not exist in the filesystem.
2 - The file exists in the filesystem but the given path is wrong.

Please note that the App Engine documentation [2] states that static files are uploaded and handled separately from application files. 

This means that if you have a file which you want to read from your Go code, the file must not match any static file pattern and cannot be in a folder defined as a static directory, or else the file will be considered to be a static file and will not be deployed along with your application code. 

I can see that the Stackoverflow question [3] has already an answer that was upvoted a by a community user. Please let me know if the answer correctly addresses your issue and whether it helps you. 

Thank you!

[1]: error loading config file: open go-config.json: no such file or directory
Reply all
Reply to author
Forward
0 new messages