Using the Pomodoro Technique to Better Utilize Your Time

For me, it’s easy to fall into a state of working all day, being busy all day but not knowing what I’m busy with, leading to anxiety the next day, not knowing what to say at the morning meeting, and only being able to do things that make me feel like I can talk. Why introduce the Pomodoro Technique: To solve this problem, I thought of many methods, such as writing a TODO list every day, but I still wasted a lot of time due to various interruptions, which made it impossible for me to complete the tasks in my original TODO list.

How to kill a process and its descendants in Unix?

Recently, I was maintaining an open source project called air on the weekend. It is a hot loading code tool for Golang, which will monitor local file changes and then automatically reload. Problem encountered Recently, I encountered a particularly interesting problem, that is, when using the kill -9 pid command to kill the process, although it will kill its child process, its grandchild process will still survive. Background In short, our hot loading component will run commands, and then will monitor file changes, once the file changes, it will kill the previous process, then recompile the code, and then execute the running command.

Golang: Making Your Zero Values More Useful

Make the zero value useful. –Go Proverbs Let’s start with the Golang blog: The zero value When memory is allocated to store a value, whether by declaration or by calling make or new, and no explicit initialization is provided, the memory is given a default initialization. Each element of this value is set to its type’s zero value: false for booleans, 0 for integers, 0.0 for floats, "" for strings, and nil for pointers, functions, interfaces, slices, channels, and maps.

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,