Skip to content

Commit

Permalink
Update tooling/templatize/pkg/config/config.go
Browse files Browse the repository at this point in the history
Co-authored-by: Steve Kuznetsov <stekuznetsov@microsoft.com>
  • Loading branch information
geoberle and stevekuznetsov committed Nov 25, 2024
1 parent ad2c1ff commit d0f3624
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tooling/templatize/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func PreprocessFile(templateFilePath string, vars map[string]any) ([]byte, error
return processedContent, nil
}

// PreprocessFile processes a gotemplate from memory
// PreprocessContent processes a gotemplate from memory
func PreprocessContent(content []byte, vars map[string]any) ([]byte, error) {
tmpl := template.New("file")
tmpl, err := tmpl.Parse(string(content))
Expand Down
20 changes: 10 additions & 10 deletions tooling/templatize/pkg/pipeline/inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import (
func TestInspectVars(t *testing.T) {
testCases := []struct {
name string
caseStep *step
caseStep *Step
options *InspectOptions
expected string
err string
}{
{
name: "basic",
caseStep: &step{
caseStep: &Step{
Action: "Shell",
Env: []EnvVar{
{
Expand All @@ -40,7 +40,7 @@ func TestInspectVars(t *testing.T) {
},
{
name: "makefile",
caseStep: &step{
caseStep: &Step{
Action: "Shell",
Env: []EnvVar{
{
Expand All @@ -59,12 +59,12 @@ func TestInspectVars(t *testing.T) {
},
{
name: "failed action",
caseStep: &step{Action: "Unknown"},
caseStep: &Step{Action: "Unknown"},
err: "inspecting step variables not implemented for action type Unknown",
},
{
name: "failed format",
caseStep: &step{Action: "Shell"},
caseStep: &Step{Action: "Shell"},
options: &InspectOptions{Format: "unknown"},
err: "unknown output format \"unknown\"",
},
Expand All @@ -86,8 +86,8 @@ func TestInspectVars(t *testing.T) {

func TestInspect(t *testing.T) {
p := Pipeline{
ResourceGroups: []*resourceGroup{{
Steps: []*step{
ResourceGroups: []*ResourceGroup{{
Steps: []*Step{
{
Name: "step1",
},
Expand All @@ -98,7 +98,7 @@ func TestInspect(t *testing.T) {
opts := NewInspectOptions(config.Variables{}, "", "step1", "scope", "format")

opts.ScopeFunctions = map[string]StepInspectScope{
"scope": func(s *step, o *InspectOptions, w io.Writer) error {
"scope": func(s *Step, o *InspectOptions, w io.Writer) error {
assert.Equal(t, s.Name, "step1")
return nil
},
Expand All @@ -110,8 +110,8 @@ func TestInspect(t *testing.T) {

func TestInspectWrongScope(t *testing.T) {
p := Pipeline{
ResourceGroups: []*resourceGroup{{
Steps: []*step{
ResourceGroups: []*ResourceGroup{{
Steps: []*Step{
{
Name: "step1",
},
Expand Down

0 comments on commit d0f3624

Please sign in to comment.