Using Mock and Interface for Golang Unit Testing

At work, I often find that many engineers' Golang unit tests are problematic, just simply calling code for output, and it will include various IO operations, making the unit test unable to run everywhere. Using Mock and Interface for Golang Unit Testing This article will introduce how to do unit testing correctly in Golang. What is unit testing? Characteristics of unit testing Unit testing is a very important part of quality assurance.

Some Details About Golang Slice

Some Details About Golang Slice In Golang, there are two types of data: One is an array with a fixed length, called Array, and the other is an array with an unlimited length, called Slice. Distinguish Between Array and Slice The difference between Array and Slice is: Array is of fixed length, and the length of Array is part of the type, so the length of Array cannot be changed,

Summary of Commonly Used Principles in Computing

Commonly Used Principles in Computing When writing code, we often have some insights and experiences. These experiences have long been summarized into principles by the predecessors. In the past year, I have been collecting various principles and constantly applying and practicing them. KISS Principle The KISS Principle is an acronym for Keep It Simple, Stupid. The KISS principle refers to the principle that simplicity should be emphasized in design. Summarizing the experience of engineering professionals in the design process, most system designs should remain simple and pure, without incorporating unnecessary complexity, so that the system can operate optimally.

Relearning English Grammar

Background I feel that there are still many deficiencies in my English, so I studied some English grammar a while ago. In fact, many of them are things that need to be learned in junior high school, but I didn’t take it seriously at that time, and I didn’t learn anything from the teacher. I can’t say that I gave everything back to the teacher, because the scenarios where English is needed in work are increasing, so I still followed Youtube and learned a lot, so I wrote this summary article.

Office Worker's Recent Half-Year Experience in Learning and Practicing Fund Investment Portfolio

“Everyone should invest, the sooner the better. Even if you keep losing money, at least you will learn how to lose less after ten years. Instead of waiting until ten years later when you are forced to invest, you lose most of your principal at once” –@xiaodotdo Preface Because I stepped into work from school, I was actually a bit richer than when I was studying, and I was also quite frugal, so I had a lot of money left every month when I got paid.