Compare commits
No commits in common. "a1708563be7b70b191ac8775efdf497f36dfdbd7" and "12afb64c2a17c1b1efb7e55cfc5f934f7cc69644" have entirely different histories.
a1708563be
...
12afb64c2a
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
/wordifier.iml
|
||||
/.idea/
|
||||
@ -3,8 +3,6 @@ package word
|
||||
import (
|
||||
zip2 "archive/zip"
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
@ -18,12 +16,11 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
func NewMacroInjectTarget(name string, marker []byte, replacement []byte) (*MacroInjectTarget, error) {
|
||||
func NewMacroInjectTarget(name string, marker []byte, replacement []byte) MacroInjectTarget {
|
||||
if len(replacement) != len(marker) {
|
||||
err := errors.New(fmt.Sprintf("Payload[%d] and target[%d] are not the same size. Make sure replacement is the same length as marker", len(replacement), len(marker)))
|
||||
return nil, err
|
||||
panic("Payload and target are not the same size. Make sure replacement is the same length as marker")
|
||||
}
|
||||
return &MacroInjectTarget{name, marker, replacement}, nil
|
||||
return MacroInjectTarget{name, marker, replacement}
|
||||
}
|
||||
|
||||
func CopyZipWithReplacements(src string, dest io.Writer, replacements []MacroInjectTarget) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user