Hacker News new | ask | show | jobs
by angra_mainyu 866 days ago
Well, I use ajv and they have ways of applying format validation, so not just saying: "this is a string", but rather, "this is a string and must be a valid domain name".

Now, if your complaint is rather that you can call whatever method and pass in your bogus data, I don't see the point in arguing that. It's your code, the only person who can stop you is you.

1 comments

> Now, if your complaint is rather that you can call whatever method and pass in your bogus data

This entire comment thread is a discussion about how to prevent that from being a possibility. The person I responded to threw their hat in with a Typescript solution that doesn’t achieve the goal being discussed. I was simply pointing this out.

>> I've found validators to be much more error-prone than leveraging Go's built-in type checker.

>This entire comment thread is a discussion about how to prevent that from being a possibility.

No, this thread is also about how much you need to invest to be safe enough, when time and resources are limited.