(filename string)
| 155 | } |
| 156 | |
| 157 | func (m *operationsFile) saveFile(filename string) (errOut error) { |
| 158 | sortOperations(m.ManualOps) |
| 159 | sortOperations(m.OverrideOps) |
| 160 | sortOperations(m.OpenapiOps) |
| 161 | f, err := os.Create(filename) |
| 162 | if err != nil { |
| 163 | return err |
| 164 | } |
| 165 | defer func() { |
| 166 | e := f.Close() |
| 167 | if errOut == nil { |
| 168 | errOut = e |
| 169 | } |
| 170 | }() |
| 171 | enc := yaml.NewEncoder(f) |
| 172 | enc.SetIndent(2) |
| 173 | defer func() { |
| 174 | e := enc.Close() |
| 175 | if errOut == nil { |
| 176 | errOut = e |
| 177 | } |
| 178 | }() |
| 179 | return enc.Encode(m) |
| 180 | } |
| 181 | |
| 182 | func (m *operationsFile) updateFromGithub(ctx context.Context, client *github.Client, ref string) error { |
| 183 | commit, resp, err := client.Repositories.GetCommit(ctx, descriptionsOwnerName, descriptionsRepoName, ref, nil) |
no test coverage detected