lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
262 stars 125 forks source link

Move validation to its own package #144

Closed andig closed 1 year ago

andig commented 2 years ago

Purpose of this PR is to allow importing of types without creating import cycles between types and ocppj. Root cause is the shared validator which originally lives in ocppj. An alternative approach would be to move the validator to types. However, that would lead to packages importing types that otherwise wouldn't need to do so.

The original motivation for doing so was https://github.com/lorenzodonini/ocpp-go/pull/145. I've implemented that without resorting to using types, so strictly speaking this PR is no longer necessary. Please feel free to close if this introduces too many changes.

I've also added handling of registration errors, i.e. panic.

Formatting changes are due to the go fmt updates of Go 1.19.

andig commented 1 year ago

Closing as #145 has been fixed.