CreateEdit creates a new edit session
()
| 167 | |
| 168 | // CreateEdit creates a new edit session |
| 169 | func (c *Client) CreateEdit() (*Edit, error) { |
| 170 | ctx, cancel := c.Context() |
| 171 | |
| 172 | edit, err := c.service.Edits.Insert(c.packageName, nil).Context(ctx).Do() |
| 173 | if err != nil { |
| 174 | cancel() |
| 175 | return nil, fmt.Errorf("failed to create edit: %w", err) |
| 176 | } |
| 177 | |
| 178 | return &Edit{ |
| 179 | client: c, |
| 180 | editID: edit.Id, |
| 181 | ctx: ctx, |
| 182 | cancel: cancel, |
| 183 | }, nil |
| 184 | } |
| 185 | |
| 186 | // GetEdit returns an existing edit by ID |
| 187 | func (c *Client) GetEdit(editID string) (*Edit, error) { |
no test coverage detected