镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

restore: Add --replace option to automatically overwrite existing container of the same name - #24

Open
andrewleech wants to merge 1 commit into
muesli:masterfrom
andrewleech:restore_replace
Open

andrewleech wants to merge 1 commit into
muesli:masterfrom
andrewleech:restore_replace

Conversation

@andrewleech

Copy link
Copy Markdown

Can be quite helpful during testing after #21

Comment thread restore.go
// io.Copy(os.Stdout, reader)

_, err = cli.ContainerInspect(ctx, name)
if err == nil {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment on #23: try to keep the happy path on the left edge. Check for an error and bail out immediately, then keep the rest of the code on the left edge.

Related: what happens in case of an error here? Shouldn't we return it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants