/wye

Joining two Go context.Contexts.

Primary LanguageGoApache License 2.0Apache-2.0

Why wye?

PkgGoDev GitHub build and test goroutines Coverage Go Report Card

When you need to mix in one (shorter-lived service) context.Context into another long-living context: kind of a “Y” joint. The opposite of Go's “⅄” pattern of deriving new contexts from existing contexts.

Why would you ever want to do this?

Because “someone” terribly messed up an API, grossly misusing contexts on them REST API client design spree.

Such as Podman's REST API client bindings.

(obligatory Captain Picard meme reference)

Installation

go get github.com/thediveo/wye

Supported Go Versions

wye supports versions of Go that are noted by the Go release policy, that is, N and N-1 major versions.

Miscellaneous

  • to view the package documentation locally:
    • either: make pkgsite,
    • or, in VSCode (using the VSCode-integrated simple browser): “Tasks: Run Task” ⇢ “View Go module documentation”.
  • make shows the available make targets.

Fun Fact

The module should have been named “waɪ”, but waɪ adding insult to injury by using a Unicode import path?

Copyright and License

Copyright 2022 Harald Albrecht, licensed under the Apache License, Version 2.0.