gitalk
gitalk copied to clipboard
Go http.ServeMux中的模式匹配
Go http.ServeMux中的模式匹配
Go 1.22中一个很大的变化是http.ServeMux中的模式匹配,先前这个功能是很多第三方的web框架或者router库实现的。 我们很有必要好好研究它,将来在实现HTTP API的时候可能优先使用它。
https://colobu.com/2023/12/25/patterns-in-ServeMux-HandleFunc/
在字符串里写 HTTP 方法,太恶心人了,都不知道这种提案怎么通过的,增加几个方法都比这好吧。