mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-10 03:47:03 +02:00
Merge branch 'master' into build
This commit is contained in:
commit
1f9f323e8f
@ -292,6 +292,7 @@ func LoadReader(fd io.Reader) (config Project, err error) {
|
|||||||
return config, checkOverflows(config)
|
return config, checkOverflows(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: check if we can use UnmarshalStrict instead of the manual checkOverflow
|
||||||
func checkOverflows(config Project) error {
|
func checkOverflows(config Project) error {
|
||||||
var overflow = &overflowChecker{}
|
var overflow = &overflowChecker{}
|
||||||
overflow.check(config.XXX, "")
|
overflow.check(config.XXX, "")
|
||||||
|
@ -42,16 +42,17 @@ type Context struct {
|
|||||||
|
|
||||||
// New context
|
// New context
|
||||||
func New(config config.Project) *Context {
|
func New(config config.Project) *Context {
|
||||||
return wrap(ctx.Background(), config)
|
return Wrap(ctx.Background(), config)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewWithTimeout new context with the given timeout
|
// NewWithTimeout new context with the given timeout
|
||||||
func NewWithTimeout(config config.Project, timeout time.Duration) (*Context, ctx.CancelFunc) {
|
func NewWithTimeout(config config.Project, timeout time.Duration) (*Context, ctx.CancelFunc) {
|
||||||
ctx, cancel := ctx.WithTimeout(ctx.Background(), timeout)
|
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{
|
return &Context{
|
||||||
Context: ctx,
|
Context: ctx,
|
||||||
Config: config,
|
Config: config,
|
||||||
|
Loading…
Reference in New Issue
Block a user