aboutsummaryrefslogtreecommitdiff
path: root/b64file/file.go
diff options
context:
space:
mode:
Diffstat (limited to 'b64file/file.go')
-rw-r--r--b64file/file.go19
1 files changed, 0 insertions, 19 deletions
diff --git a/b64file/file.go b/b64file/file.go
index 9254303..6f5dd28 100644
--- a/b64file/file.go
+++ b/b64file/file.go
@@ -10,7 +10,6 @@ import (
"fmt"
"io"
"io/ioutil"
- "os"
"strings"
)
@@ -19,15 +18,6 @@ const untrusted = "untrusted comment: "
// Original Error: "invalid comment in %s; must start with 'untrusted comment: '"
var ErrUntrusted = errors.New("comment must start with 'untrusted comment: '")
-func DecodeFile(fname string, u encoding.BinaryUnmarshaler) (string, []byte, error) {
- fd, err := os.Open(fname)
- if err != nil {
- return "", nil, err
- }
- defer fd.Close()
- return Decode(fd, u)
-}
-
func DecodeString(data string, u encoding.BinaryUnmarshaler) (string, []byte, error) {
r := strings.NewReader(data)
return Decode(r, u)
@@ -70,15 +60,6 @@ func Decode(r io.Reader, u encoding.BinaryUnmarshaler) (string, []byte, error) {
return comment, message, nil
}
-func EncodeFile(fname string, perm os.FileMode, u encoding.BinaryMarshaler, comment string, msg []byte) error {
- fd, err := os.OpenFile(fname, os.O_WRONLY|os.O_CREATE|os.O_EXCL, perm)
- if err != nil {
- return err
- }
- defer fd.Close()
- return Encode(fd, u, comment, msg)
-}
-
func Encode(w io.Writer, u encoding.BinaryMarshaler, comment string, msg []byte) error {
raw, err := u.MarshalBinary()
if err != nil {