droyo / styx

Go library for the 9P filesystem protocol
MIT License
64 stars 18 forks source link

correct error message so that the type failing conversion is correctly reported. #5

Closed marzhall closed 5 years ago

marzhall commented 6 years ago

Before this change, the error reported for types failing conversion would always be:

/ open Cannot convert type %!T(MISSING) into a styxfile.Interface failed: %!s(MISSING)

regardless of the type failing conversion. This was because the type value rwc was not being passed to the fmt function.

I've updated the code to move the default case into the switch scope, where I then added the argument for type being switched upon. This correctly reports the type being used.

droyo commented 6 years ago

Thank you for catching this. It appears my automated tests are failing due to an upgrade to go1.10 which is being stricter during test runs.

marzhall commented 6 years ago

Okay! In the mean time, I've found and corrected another debugging message. Now, instead of:

/ open Cannot convert type <type> into a styxfile.Interface failed: %!s(MISSING)

the message is

open / falied: Cannot convert type <type> into a styxfile.Interface

Let me know if you'd like me to open new branches if I find any more fixes for debug stuff while this branch still hasn't been merged. Thanks!

droyo commented 6 years ago

If you keep finding bugs in this same topic you can just keep adding it to this PR. I should have time to fix my tests this weekend, and if I can't do that I'll just merge this as it isn't triggering the test failures.