mirror of
https://github.com/gopasspw/gopass.git
synced 2026-10-20 04:18:28 +02:00
This commit adds yet another config handler for gopass. It is based on the format used by git itself. This has the potential to address a lot of long standing issues, but it also causes a lot of changes to how we handle configuration, so bugs are inevitable. Fixes #1567 Fixes #1764 Fixes #1819 Fixes #1878 Fixes #2387 Fixes #2418 RELEASE_NOTES=[BREAKING] New config format based on git config. Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> Co-authored-by: Yolan Romailler <AnomalRoil@users.noreply.github.com> address comments Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
26 lines
521 B
Go
26 lines
521 B
Go
package age
|
|
|
|
import "context"
|
|
|
|
type contextKey int
|
|
|
|
const (
|
|
ctxKeyOnlyNative contextKey = iota
|
|
)
|
|
|
|
// WithOnlyNative will return a context with the flag for only native set.
|
|
func WithOnlyNative(ctx context.Context, at bool) context.Context {
|
|
return context.WithValue(ctx, ctxKeyOnlyNative, at)
|
|
}
|
|
|
|
// IsOnlyNative will return the value of the only native flag or the default
|
|
// (false).
|
|
func IsOnlyNative(ctx context.Context) bool {
|
|
bv, ok := ctx.Value(ctxKeyOnlyNative).(bool)
|
|
if !ok {
|
|
return false
|
|
}
|
|
|
|
return bv
|
|
}
|