| 394 | } |
| 395 | |
| 396 | func updateGist(apiClient *api.Client, hostname string, gist gistToUpdate) error { |
| 397 | requestByte, err := json.Marshal(gist) |
| 398 | if err != nil { |
| 399 | return err |
| 400 | } |
| 401 | |
| 402 | requestBody := bytes.NewReader(requestByte) |
| 403 | result := shared.Gist{} |
| 404 | |
| 405 | path := "gists/" + gist.id |
| 406 | err = apiClient.REST(hostname, "POST", path, requestBody, &result) |
| 407 | if err != nil { |
| 408 | return err |
| 409 | } |
| 410 | |
| 411 | return nil |
| 412 | } |
| 413 | |
| 414 | func getFilesToAdd(file string, content []byte) (map[string]*gistFileToUpdate, error) { |
| 415 | if shared.IsBinaryContents(content) { |