move: magic from internal

This commit is contained in:
Inanc Gumus
2019-08-06 01:33:55 +03:00
parent eb8f9987a8
commit c97becdf82
3 changed files with 4 additions and 3 deletions

View File

@ -11,10 +11,10 @@ import (
"fmt"
"os"
"github.com/inancgumus/learngo/internal/magic"
"github.com/inancgumus/learngo/magic"
//
// Use the following one for the panicking library:
// magic "github.com/inancgumus/learngo/internal/magicpanic"
// magic "github.com/inancgumus/learngo/magicpanic"
//
)

View File

@ -9,6 +9,7 @@ package magic
import (
"bytes"
"errors"
"fmt"
"io"
"os"
@ -63,7 +64,7 @@ func read(filename string, buf []byte) error {
}
if fi.Size() <= int64(len(buf)) {
return fmt.Errorf("file size < len(buf)")
return errors.New("file size < len(buf)")
}
_, err = io.ReadFull(file, buf)