xuanyu.ca·May 18, 2025 · 4 min readTest in Go: clean environment for each test caseI can not address unit tests enough. It’s every developer’s best friend. Of course, writing and maintaining unit tests costs a lot of time. Being a developer is not easy. Who’s your allies that always stands with you? Unit tests. What about our bosse...00
xuanyu.ca·Dec 25, 2024 · 3 min readUnmasking Hidden Test Pitfalls in Go: Avoiding False PositivesThe nightmare in testing would be false positive. “Every thing is passing! Amazing!” until at an unknown time in the future all the mines explode together and blow your team to hell. There are many reasons that tests could fail silently. Today, I’m g...00
xuanyu.ca·May 21, 2024 · 9 min readPagination condition for multiple columnsThere are many ways to do pagination in production. In this article, I'll explore an efficient method for pagination in production environments: fetching records up to the page size using conditions based on the last record's values. This approach en...00
xuanyu.ca·Feb 18, 2024 · 3 min readTest in Go: risk of using CleanupMy team is using testify as the testing framework for Go. We noticed that many methods provided by testify/suite can be easily achieved by the built-in testing package. For example, using Cleanup can do the same of AfterTest provided by testify/suite...00
xuanyu.ca·Feb 12, 2024 · 3 min readTest in Go: the order of Cleanup is not what you thinkThe framework testify might be the most popular. Surprisingly, I find the documentation is not clear enough to answer my questions and I can't find answers anywhere. Therefore, I have to write experiments to verify my guesses. One of my questions is:...00