schemaFiles describes each schema the checker tried to load.
()
| 106 | |
| 107 | // schemaFiles describes each schema the checker tried to load. |
| 108 | func (c *checker) schemaFiles() []schemaFile { |
| 109 | var files []schemaFile |
| 110 | for _, f := range []struct { |
| 111 | source schemaSource |
| 112 | file schemaFile |
| 113 | err error |
| 114 | }{ |
| 115 | {graphQLSource, c.gqlFile, c.gqlErr}, |
| 116 | {restSource, c.restFile, c.restErr}, |
| 117 | } { |
| 118 | switch { |
| 119 | case f.err != nil: |
| 120 | files = append(files, schemaFile{Name: f.source.label, Error: f.err.Error()}) |
| 121 | case f.file.SHA256 != "": |
| 122 | files = append(files, f.file) |
| 123 | } |
| 124 | } |
| 125 | return files |
| 126 | } |
| 127 | |
| 128 | // unavailable describes each schema that couldn't be loaded. |
| 129 | func (c *checker) unavailable() []string { |