move: magic from internal
This commit is contained in:
@ -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"
|
||||
//
|
||||
)
|
||||
|
||||
|
@ -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)
|
Reference in New Issue
Block a user