move: magic from internal
This commit is contained in:
@ -11,10 +11,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/inancgumus/learngo/internal/magic"
|
"github.com/inancgumus/learngo/magic"
|
||||||
//
|
//
|
||||||
// Use the following one for the panicking library:
|
// 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 (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
@ -63,7 +64,7 @@ func read(filename string, buf []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if fi.Size() <= int64(len(buf)) {
|
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)
|
_, err = io.ReadFull(file, buf)
|
Reference in New Issue
Block a user