This blog discusses why the Foldable requires m as a monoid at least. Through the minimal requirements of them, we could better understand what happens during execution of foldable, and why we need it.
This blog records the tricky part of using reflect to get an empty interface type correctly. The background is that a component requires the configuration type during function call as it might use the type to construct a type and set up the value based on some external data set. If we cannot find a respective in some scenarios, empty interface type should be passed.
However, at the beginning due to the wrong usage of reflect, a nil type instead of interface{} type is passed by reflect.TypeOf(i).
variinterface{}// this is correcttyp:=reflect.TypeOf(&i).Elem()// this is wrong usage, the typ is niltyp:=reflect.TypeOf(i)
Given a URL /api/users/1234/pages, how an HTTP server finds the corresponding handler for it? Router helps to convert the concrete URL to a pattern and its handler.
This blog introduces the routers in Gin framework. In short, Gin uses trie(prefix tree) to maintain the URL-handler mapping.
Recently, my company abandoned docker desktop because it requires the company to paid for its services. As a result, the company treats as an unnecessary cost and asks the developers to find another alternatives. This blog records the troublesome during my migration.
This blog is the reading notes for the book HTTP/2 in Action. It requires the knowledge of HTTP/1.1 as I will only show the drawbacks of HTTP/1.1 the HTTP/2 intends to solve.
The book itself is nice, and cover all the main features with details. The only problem is the epub book has lost several diagrams and the contents of frames occupied a few pages while reading in my Kindle:(