Skip to content

Graceful: use context #14

@batazor

Description

@batazor
    stop := make(chan os.Signal)
    signal.Notify(stop, syscall.SIGINT)

    ctx, cancel := context.WithCancel(context.Background())

    go func() {
        <-stop
        cancel()
    }()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions