Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 6284982

Browse files
committed
Removing print statements & formatting
Signed-off-by: GodFather <vito.blog@gmail.com>
1 parent fcc0323 commit 6284982

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

config/interpolation.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ func parseDefaultValue(line string, pos int, mapping func(string) string) (strin
4747
success := false
4848
replaced := ""
4949

50-
fmt.Printf("INCOMING: %v\n", string(line[pos]))
5150
// only skip :, :- and - at the beginning
5251
for ; pos < len(line); pos++ {
5352
c := line[pos]
54-
fmt.Printf("SKIP: %v\n", string(c))
5553
if c == ':' || c == '-' {
5654
continue
5755
}
@@ -62,26 +60,19 @@ func parseDefaultValue(line string, pos int, mapping func(string) string) (strin
6260
switch {
6361
case c == '$':
6462
if line[pos-1] != '\\' {
65-
fmt.Printf("NESTED: %v pos: %v\n", string(c), pos)
66-
replaced, pos, success = parseInterpolationExpression(line, pos + 1, mapping)
63+
replaced, pos, success = parseInterpolationExpression(line, pos+1, mapping)
6764
_, err := buffer.WriteString(replaced)
68-
fmt.Printf("REPLACED: %v pos: %v\n", replaced, pos)
6965
if success == false || err != nil {
7066
return "", 0, false
7167
}
7268
}
7369
case c == '}':
74-
fmt.Printf("ENDIT: %v\n", string(c))
7570
return buffer.String(), pos - 1, true
7671
default:
77-
fmt.Printf("APPEND: %v\n", string(c))
78-
// err := buffer.WriteByte(c)
7972
if err := buffer.WriteByte(c); err != nil {
8073
return "", pos, false
8174
}
82-
fmt.Printf("APPEND: %v\n", string(c))
8375
}
84-
fmt.Printf("BUFFER: %v\n", string(buffer.String()))
8576
}
8677
return "", 0, false
8778
}
@@ -91,7 +82,6 @@ func parseVariableWithBraces(line string, pos int, mapping func(string) string)
9182

9283
for ; pos < len(line); pos++ {
9384
c := line[pos]
94-
fmt.Printf("val: %v\n", string(c))
9585

9686
switch {
9787
case c == '}':

config/interpolation_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ func testInterpolatedLine(t *testing.T, expectedLine, interpolatedLine string, e
1515
return envVariables[s]
1616
})
1717

18-
fmt.Printf("EXPECTED: %s and ACTUAL: %s\n", expectedLine, interpolatedLine)
1918
assert.Equal(t, expectedLine, interpolatedLine)
2019
}
2120

@@ -29,7 +28,6 @@ func testInvalidInterpolatedLine(t *testing.T, line string) {
2928

3029
func testInterpolatedDefault(t *testing.T, line string, delim string, expectedVar string, expectedVal string, envVariables map[string]string) {
3130
envVar, _ := parseLine(line, func(s string) string {
32-
fmt.Printf("request: %v\n", s)
3331
if val, ok := envVariables[s]; ok {
3432
return val
3533
}
@@ -38,14 +36,11 @@ func testInterpolatedDefault(t *testing.T, line string, delim string, expectedVa
3836

3937
pos := strings.Index(line, delim)
4038
envDefault, _, _ := parseDefaultValue(line, pos, func(s string) string {
41-
fmt.Printf("request: %v\n", s)
4239
if val, ok := envVariables[s]; ok {
4340
return val
4441
}
4542
return s
4643
})
47-
fmt.Printf("EXPECTED: %s and ACTUAL: %s\n", expectedVal, envDefault)
48-
fmt.Printf("EXPECTED: %s and ACTUAL: %s\n", expectedVar, envVar)
4944
assert.Equal(t, expectedVal, envDefault)
5045
assert.Equal(t, expectedVar, envVar)
5146
}

0 commit comments

Comments
 (0)