-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
successfully able to run simple workflows
- Loading branch information
Unit Test
committed
Feb 7, 2020
1 parent
8c49ba0
commit 6f8f063
Showing
23 changed files
with
912 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package common | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
type dryrunContextKey string | ||
|
||
const dryrunContextKeyVal = dryrunContextKey("dryrun") | ||
|
||
// Dryrun returns true if the current context is dryrun | ||
func Dryrun(ctx context.Context) bool { | ||
val := ctx.Value(dryrunContextKeyVal) | ||
if val != nil { | ||
if dryrun, ok := val.(bool); ok { | ||
return dryrun | ||
} | ||
} | ||
return false | ||
} | ||
|
||
// WithDryrun adds a value to the context for dryrun | ||
func WithDryrun(ctx context.Context, dryrun bool) context.Context { | ||
return context.WithValue(ctx, dryrunContextKeyVal, dryrun) | ||
} |
Oops, something went wrong.