3 ms·
Hard panic in a "not simple app with large codebase" app because you couldn't match a route is amateur hour.
by troupo 3y ago
Hard panic in a "not simple app with large codebase" app because you couldn't match a route is amateur hour.
- numbsafari 3y agoI think you are vastly oversimplifying what has been said or why it works the way that it does. I really recommend you read the design document and reasoning, as it is rather clear why they are doing it the way that they are. If you have a cogent contribution to the discussion, please do share.
- troupo 3y agoOthers have already contributed more than enough. People's willingness to defend any and all of go's dubious decisions is really baffling.
- msmith 3y agoI think you're assuming that the panic happens when a request is received, but it actually happens when a conflicting route is registered. To me, that's reasonable behavior and is consistent with other things such as https://pkg.go.dev/regexp#MustCompile https://pkg.go.dev/regexp#MustCompile
- smoyer 3y agoRegistering handlers is a startup activity ... Practically the only time I allow a panic in my code. I also have unit tests for the entire startup sequence so theoretically code with ambiguous handlers would never be committed.