Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protecting users of obsolete API (pre AssetInfo) #36

Open
peterhoward42 opened this issue Jun 14, 2016 · 0 comments
Open

Protecting users of obsolete API (pre AssetInfo) #36

peterhoward42 opened this issue Jun 14, 2016 · 0 comments

Comments

@peterhoward42
Copy link

I wonder if you would consider a change to AssetFS to protect others from a problem I had, and took quite a while for me to find the root cause?

I have a project that used your older API (without the AssetInfo field).

http.Handle("/",
http.FileServer(
&assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir}))

My project still compiled fine with the newer versions of AssetFS code despite what is now a missing initialiser, but hits a null pointer error at run time at line 148 in assetfs.go with this:

if info, err := fs.AssetInfo(name); err == nil {

All fine now I updated my call of course, but shame to require others who hit the same problem to dig into AssetFS source to work out what's happening.

Pete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant