Expected behavior
I expect to get something like an invalid format error, or at least a panic with a message, like:
can't unmarshal: incorrect WKT format
Current behavior
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/paulmach/orb/encoding/wkt.trimSpaceBrackets({0x0?, 0xa?})
/home/kirill/go/pkg/mod/github.com/paulmach/orb@v0.7.1/encoding/wkt/unmarshal.go:125 +0x9c
github.com/paulmach/orb/encoding/wkt.Unmarshal({0x4a26bf?, 0x53a780?})
/home/kirill/go/pkg/mod/github.com/paulmach/orb@v0.7.1/encoding/wkt/unmarshal.go:256 +0x4df
main.main()
/home/kirill/go/src/github.com/sosiska/wkt/main.go:12 +0x29
Process finished with the exit code 2
Hello! I found a panic in the
wkt.Unmarshal
function.Problem Panic occurs when using the
wkt.Unmarshal
function fromorb/encoding/wkt
package.How to reproduce
Expected behavior I expect to get something like an invalid format error, or at least a panic with a message, like:
Current behavior