When an unsupported shape type is encountered, log.Fatal is called. This
is undesirable for a library, as the user should decide when to abort
program execution.
This change modifies newShape to return an error when encountering an
unsupported shape type, and adds a test to verify that reading is
aborted in this case. To facilitate testing, the hard dependency on
os.File in the Reader is replaced with an interface encapsulating all
required methods.
When an unsupported shape type is encountered, log.Fatal is called. This is undesirable for a library, as the user should decide when to abort program execution.
This change modifies newShape to return an error when encountering an unsupported shape type, and adds a test to verify that reading is aborted in this case. To facilitate testing, the hard dependency on os.File in the Reader is replaced with an interface encapsulating all required methods.