markbates / pkger

Embed static files in Go binaries (replacement for gobuffalo/packr)
MIT License
1.19k stars 60 forks source link

Should return os.ErrNotExist in pkged mode #141

Open Shark opened 3 years ago

Shark commented 3 years ago

Thanks @markbates for creating this library. It makes our lives easier! 💙

Version v0.17.1

info, err = pkger.Stat("/idontexist")

When I run this,

I feel like using os.IsNotExist is a standard way to find the root cause and handle it appropriately, for example return status code 404 instead of 500.

The code in question is in mem.go.