Format sources with gofmt (#472)

Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
KADOTA, Kyohei
2021-01-15 14:37:38 +09:00
committed by GitHub
parent 41692c314d
commit e6fcfed458
6 changed files with 8 additions and 11 deletions

View File

@@ -61,8 +61,8 @@ type expressionEvaluator struct {
}
func (ee *expressionEvaluator) Evaluate(in string) (string, bool, error) {
if strings.HasPrefix(in, `secrets.`){
in = `secrets.`+strings.ToUpper(strings.SplitN(in, `.`, 2)[1])
if strings.HasPrefix(in, `secrets.`) {
in = `secrets.` + strings.ToUpper(strings.SplitN(in, `.`, 2)[1])
}
re := ee.Rewrite(in)
if re != in {
@@ -84,7 +84,7 @@ func (ee *expressionEvaluator) Evaluate(in string) (string, bool, error) {
return valAsString, val.IsString(), err
}
func (ee *expressionEvaluator) Interpolate(in string) string{
func (ee *expressionEvaluator) Interpolate(in string) string {
interpolated, _ := ee.InterpolateWithStringCheck(in)
return interpolated
}

View File

@@ -219,7 +219,7 @@ jobs:
expr := expressionPattern.ReplaceAllStringFunc(table.in, func(match string) string {
return fmt.Sprintf("€{{ %s }}", expressionPattern.ReplaceAllString(match, "$1"))
})
name := fmt.Sprintf(`%s -> %s should be equal to %s`,expr, table.in, table.out)
name := fmt.Sprintf(`%s -> %s should be equal to %s`, expr, table.in, table.out)
echo := `run: echo "Done "`
workflow += fmt.Sprintf(`
- name: %s

View File

@@ -206,7 +206,7 @@ func (rc *RunContext) newStepExecutor(step *model.Step) common.Executor {
if err != nil {
return err
}
rc.ExprEval = exprEval;
rc.ExprEval = exprEval
runStep, err := rc.EvalBool(sc.Step.If)
if err != nil {

View File

@@ -101,14 +101,12 @@ func (sc *StepContext) mergeEnv() map[string]string {
return env
}
func (sc *StepContext) interpolateEnv(exprEval ExpressionEvaluator) {
for k, v := range sc.Env {
sc.Env[k] = exprEval.Interpolate(v)
}
}
func (sc *StepContext) setupEnv(ctx context.Context) (ExpressionEvaluator, error) {
rc := sc.RunContext
sc.Env = sc.mergeEnv()
@@ -125,7 +123,6 @@ func (sc *StepContext) setupEnv(ctx context.Context) (ExpressionEvaluator, error
return evaluator, nil
}
func (sc *StepContext) setupShellCommand() common.Executor {
rc := sc.RunContext
step := sc.Step