You've already forked goreleaser
							
							
				mirror of
				https://github.com/goreleaser/goreleaser.git
				synced 2025-10-30 23:58:09 +02:00 
			
		
		
		
	style: make context.Wrap public
This commit is contained in:
		| @@ -291,6 +291,7 @@ func LoadReader(fd io.Reader) (config Project, err error) { | ||||
| 	return config, checkOverflows(config) | ||||
| } | ||||
|  | ||||
| // TODO: check if we can use UnmarshalStrict instead of the manual checkOverflow | ||||
| func checkOverflows(config Project) error { | ||||
| 	var overflow = &overflowChecker{} | ||||
| 	overflow.check(config.XXX, "") | ||||
|   | ||||
| @@ -42,16 +42,17 @@ type Context struct { | ||||
|  | ||||
| // New context | ||||
| func New(config config.Project) *Context { | ||||
| 	return wrap(ctx.Background(), config) | ||||
| 	return Wrap(ctx.Background(), config) | ||||
| } | ||||
|  | ||||
| // NewWithTimeout new context with the given timeout | ||||
| func NewWithTimeout(config config.Project, timeout time.Duration) (*Context, ctx.CancelFunc) { | ||||
| 	ctx, cancel := ctx.WithTimeout(ctx.Background(), timeout) | ||||
| 	return wrap(ctx, config), cancel | ||||
| 	return Wrap(ctx, config), cancel | ||||
| } | ||||
|  | ||||
| func wrap(ctx ctx.Context, config config.Project) *Context { | ||||
| // Wrap wraps an existing context | ||||
| func Wrap(ctx ctx.Context, config config.Project) *Context { | ||||
| 	return &Context{ | ||||
| 		Context:     ctx, | ||||
| 		Config:      config, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user