AddConfig returns a mutable config structure based on a shallow copy of that found in ctx and returns a new context with that added to it.
(ctx context.Context)
| 822 | // copy of that found in ctx and returns a new context with that added |
| 823 | // to it. |
| 824 | func AddConfig(ctx context.Context) (context.Context, *ConfigInfo) { |
| 825 | c := GetConfig(ctx) |
| 826 | cCopy := new(ConfigInfo) |
| 827 | *cCopy = *c |
| 828 | newCtx := context.WithValue(ctx, configContextKey, cCopy) |
| 829 | return newCtx, cCopy |
| 830 | } |
| 831 | |
| 832 | // ConfigToEnv converts a config section and name, e.g. ("my-remote", |
| 833 | // "ignore-size") into an environment name |
searching dependent graphs…