Validate configuration after loading
Review Request #10006 — Created June 7, 2018 and submitted
We now validate the parsed
config.json
and check for any omitted
fields. Go doesn't let us error on a missing field during
json.Unmarshall
so we have to check for its 0 value (e.g.,""
for
strings). We now return an error if any required field is missing. In
the case of a missing Port field, we default to 8888 and log a warning
message.Additionally, all files specfied in
config.json
are resolve relative
to the path of the config file unless they are absolute paths.
Testing done:
Rango fmt ./...
.
Rango test ./...
.
- Description:
-
We now validate the parsed
config.json
and check for any omittedfields. Go doesn't let us error on a missing field during json.Unmarshall
so we have to check for its 0 value (e.g.,""
forstrings). We now return an error if any required field is missing. In the case of a missing Port field, we default to 8888 and log a warning message. + + Additionally, all files specfied in
config.json
are resolve relative+ to the path of the config file unless they are absolute paths. - Commit:
-
31b8f0e01f8ffc0c8e3bb82457d944d284b55f7fc2e184a2a424bfa97e137c74969947f87ff7d1b8
- Diff:
-
Revision 2 (+235 -1)
Checks run (2 succeeded)
- Change Summary:
-
go fmt
- Commit:
-
c2e184a2a424bfa97e137c74969947f87ff7d1b854024c996e3236bfa07babee6c48138b2e33c6cd
Checks run (2 succeeded)
- Commit:
-
54024c996e3236bfa07babee6c48138b2e33c6cd17a3da93f3d85acce359ae651cf324b93217f12e