79196958

Date: 2024-11-17 10:18:30
Score: 1
Natty:
Report link

Just Wondering why do you need to pass the dir path to New method when creating a new validator instance. Shouldn't it be aware of where its required docs are located? I think, Instead of feeding a new Validator instance with the path:

func New(xsdPath string) (*Validator, error) 

it should be aware of the path itself without receiving it from outer world. You might explore vendoring this package.

There's many more recommendations like wrapping errors before returning them from a function to carry as much info for logging purposes instead of printing to stdout like here: https://github.com/lanart/ubl/blob/b6bf077959bbd17933750f4a1f71155ab2ba1c0d/validator/validator.go#L51 . Additionally the project design might need revisiting but I'm afraid I need more time to dive into its details & learn more about the business aspect to determine what exactly you wanna achieve.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Ahmad Saeed Goda