←back to thread

113 points markusw | 1 comments | | HN request time: 0.211s | source

Hey everyone! I just released v1.0.0 of gomponents last week. It's an HTML component builder in pure Go, with a DSL-like HTML syntax. It's been 4 years in the making, and makes it really easy to build HTML in your web apps.
Show context
kubb ◴[] No.41878237[source]
I saw the dot imports and thought “What a neat feature! I wonder why nobody uses it.” Then I googled it and saw a million articles saying how they should be avoided and removed from the language because they make code more difficult to understand.

Typical gophers, can’t accept that there’s a time and place for everything and need to have a hard rule to use that applies to every single situation. Imagine that code, but with gomponents.Ul, gomponents.Li, gomponents.Div everywhere.

replies(4): >>41878272 #>>41878351 #>>41880180 #>>41880321 #
1. ofrzeta ◴[] No.41880180[source]
It's the same with the Ginkgo testing library: "After the package books_test declaration we import the ginkgo and gomega packages into the test's top-level namespace by performing a . dot-import. Since Ginkgo and Gomega are DSLs this makes the tests more natural to read."

https://onsi.github.io/ginkgo/