aboutsummaryrefslogtreecommitdiff
path: root/b64file
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-08-04 23:57:58 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-08-04 23:57:58 +0200
commit6394bf32ee3cc1fa74259f9366b4616276485acf (patch)
tree67c7ceb91475b5241493196cff5be0331965466a /b64file
parent245a41f1fa992fefb396fc4591a2bbdd6858e525 (diff)
Less clutter
Diffstat (limited to 'b64file')
-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 {