aboutsummaryrefslogtreecommitdiff
path: root/lib/net/html/example_node_iterator_test.go
AgeCommit message (Collapse)Author
2024-03-09lib: move package "net/html" to "lib/html"Shulhan
Putting "html" under "net" package make no sense. Another reason is to make the package flat under "lib/" directory.
2024-03-05all: comply with linter recommendations #2Shulhan
HTTP request now implicitly create request with context. Any false positive related to not closing HTTP response body has been annotated with "nolint:bodyclose". In the example code, use consistent "// Output:" comment format, by prefixing with single space. Any comment on code now also prefixing with single space. An error returned without variables now use [errors.New] instead of [fmt.Errorf]. Any error returned using [fmt.Errorf] now wrapped using "%w" instead of "%s". Also, replace error checking using [errors.Is] or [errors.As], instead of using equal/not-equal operator. Any statement like "x = x OP y" now replaced with "x OP= y". Also, swap statement is simplified using "x, y = y, x". Any switch statement with single case now replaced with if-condition. Any call to defer on function or program that call [os.Exit], now replaced by calling the deferred function directly. Any if-else condition now replaced with switch statement, if possible.
2020-06-10all: update email addressShulhan
2020-05-16all: fix and suppress linter warningsShulhan
2020-04-05html: add function to simplify iterating node in HTML treeShulhan
The NodeIterator have the method Next() that will return the first child or the next sibling of current node, iteratively from top to bottom.