Skip to content

Commit

Permalink
feat(code): rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
budimanjojo committed Sep 26, 2022
1 parent 9ff03c9 commit 04a828f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/genconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var (
}
}

cfFile, err := substitute.SubstituteEnvFromYaml(cf)
cfFile, err := substitute.SubstituteEnvFromByte(cf)
if err != nil {
log.Fatalf("failed to substitute env: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/patcher/patcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func PatchesPatcher(patches []string, target []byte) ([]byte, error) {
return nil, err
}

p, err := substitute.SubstituteEnvFromYaml(contents)
p, err := substitute.SubstituteEnvFromByte(contents)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/substitute/envsubst.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func LoadEnv(file []byte) error {
return nil
}

func SubstituteEnvFromYaml(file []byte) ([]byte, error) {
func SubstituteEnvFromByte(file []byte) ([]byte, error) {
filtered := stripYamlComment(file)
data, err := envsubst.BytesRestricted(filtered, true, true)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/substitute/envsubst_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ d: default value
t.Fatal(err)
}

result, _ := SubstituteEnvFromYaml([]byte(file))
result, _ := SubstituteEnvFromByte([]byte(file))
if expected != string(result) {
t.Errorf("got %s, want %s", string(result), expected)

Expand Down

0 comments on commit 04a828f

Please sign in to comment.