Open CDaxi opened 4 years ago
Example code:
addr := "127.0.0.1:9000" d := osc.NewStandardDispatcher() d.AddMsgHandler("/time/str", func (msg *osc.Message) { fmt.Print("-> ") fmt.Println(msg) })
Example console output:
-> /time ,f 16743.264 -> /time/str ,s 4:39:03.263 -> /time ,f 16743.36 -> /time/str ,s 4:39:03.359
The code should only match /time/str but the MsgHandler matches /time without str too. This code lines seems to be the reason: https://github.com/hypebeast/go-osc/blob/master/osc/osc.go#L146 https://github.com/hypebeast/go-osc/blob/master/osc/osc.go#L212
/time/str
/time
Escaping the address with \/ does not help. If I do this, I will get an error unknown escape sequence
\/
unknown escape sequence
Current workaround:
I would be very happy to have this issue fixed because this creates very confusing issues.
Thanks a lot. Christian
Example code:
Example console output:
The code should only match
/time/str
but the MsgHandler matches/time
without str too. This code lines seems to be the reason: https://github.com/hypebeast/go-osc/blob/master/osc/osc.go#L146 https://github.com/hypebeast/go-osc/blob/master/osc/osc.go#L212Escaping the address with
\/
does not help. If I do this, I will get an errorunknown escape sequence
Current workaround:
I would be very happy to have this issue fixed because this creates very confusing issues.
Thanks a lot. Christian