Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
awitas committed Mar 14, 2023
2 parents 170d1f1 + 7c7f7aa commit 408bd3e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
local_test.go
*.iml
2 changes: 1 addition & 1 deletion modifier/replacer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

//Replace return modification handler with the specified replacements map
func Replace(replacements map[string]string) option.Modifier {
return func(info os.FileInfo, reader io.ReadCloser) (os.FileInfo, io.ReadCloser, error) {
return func(_ string, info os.FileInfo, reader io.ReadCloser) (os.FileInfo, io.ReadCloser, error) {
data, err := ioutil.ReadAll(reader)
if err != nil {
return nil, nil, err
Expand Down
2 changes: 1 addition & 1 deletion modifier/replacer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestReplace(t *testing.T) {
})

info := file.NewInfo("blah", 0, 0644, time.Now(), false)
_, reader, err := replaceer(info, ioutil.NopCloser(strings.NewReader("test is test")))
_, reader, err := replaceer("", info, ioutil.NopCloser(strings.NewReader("test is test")))
assert.Nil(t, err)
actual, _ := ioutil.ReadAll(reader)
assert.EqualValues(t, "Test is Test", actual)
Expand Down

0 comments on commit 408bd3e

Please sign in to comment.