Debug vs Release in CMake

With CMake, it’s generally recommended to do an “out of source” build. Create your CMakeLists.txt in the root of your project. Then from the root of your project: And for Debug (again from the root of your project): Release / Debug will add the appropriate flags for your compiler. There are also RelWithDebInfo and MinSizeRel build configurations. You can modify/add to the flags by specifying a toolchain file in … Read more

Meaning of @classmethod and @staticmethod for beginner?

Though classmethod and staticmethod are quite similar, there’s a slight difference in usage for both entities: classmethod must have a reference to a class object as the first parameter, whereas staticmethod can have no parameters at all. Example Explanation Let’s assume an example of a class, dealing with date information (this will be our boilerplate): This class obviously could be used to store … Read more

Passing as const and by reference – Worth it?

Passing by const reference is the preferred way to pass around objects as a smart alternative to pass-by-value. When you pass by const reference, you take the argument in by reference (avoiding making any copies of it), but cannot make any changes to the original object (much as would happen when you would take the parameters in by value). … Read more

How to set GOPRIVATE environment variable

Short Answer: OR If you want to allow all private repos from your organization Long Answer: Check “Module configuration for non-public modules” for more information: The GOPRIVATE environment variable controls which modules the go command considers to be private (not available publicly) and should therefore not use the proxy or checksum database. The variable is a comma-separated … Read more

Categories go

Notepad++ add to every line

Follow these steps: Press Ctrl+H to bring up the Find/Replace Dialog. Choose the Regular expression option near the bottom of the dialog. To add a word, such as test, at the beginning of each line: Type ^ in the Find what textbox Type test in the Replace with textbox Place cursor in the first line of the file to ensure all lines are affected Click Replace All button To add a word, … Read more