1
0
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:
Carlos Alexandro Becker 2018-01-21 21:54:57 -02:00
commit 1f9f323e8f
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 5 additions and 3 deletions

View File

@ -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, "")

View File

@ -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,