diff --git a/28-error-handling/04b-named-params/main.go b/28-error-handling/04b-named-params/main.go index 917c562..d1bc9f2 100644 --- a/28-error-handling/04b-named-params/main.go +++ b/28-error-handling/04b-named-params/main.go @@ -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" // ) diff --git a/internal/magic/detect.go b/magic/detect.go similarity index 96% rename from internal/magic/detect.go rename to magic/detect.go index 59d22db..c13571d 100644 --- a/internal/magic/detect.go +++ b/magic/detect.go @@ -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) diff --git a/internal/magicpanic/detect.go b/magicpanic/detect.go similarity index 100% rename from internal/magicpanic/detect.go rename to magicpanic/detect.go