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: |
|
|||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
|||||||||||||||||||||||||||
Diff: |
Revision 2 (+235 -1) |
Checks run (2 succeeded)
Change Summary:
go fmt
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+235 -2) |
Checks run (2 succeeded)
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+235 -2) |
Checks run (2 succeeded)
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+235 -2) |