Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between two gin modes, debug and release? [closed]

Tags:

go

I mean the different modes of gin, which is the http framework of Golang, not of the VS IDE.

like image 294
Niubility Avatar asked Jan 11 '19 06:01

Niubility


People also ask

What is the difference between debug and release mode?

Debug Mode: When we are developing the application. Release Mode: When we are going to production mode or deploying the application to the server. Debug Mode: The debug mode code is not optimized. Release Mode: The release mode code is optimized.

What is the difference between debug build and release build?

The Debug configuration of your program is compiled with full symbolic debug information which help the debugger figure out where it is in the source code. Is Release mode is faster than Debug mode ? The Release mode enables optimizations and generates without any debug data, so it is fully optimized. .

What is release mode and debug mode in Visual Studio?

Visual Studio projects have separate release and debug configurations for your program. You build the debug version for debugging and the release version for the final release distribution. In debug configuration, your program compiles with full symbolic debug information and no optimization.

How do I run Gin in release mode?

Just add gin. SetMode(gin. ReleaseMode) in your main function. I will try it with upper case R in "ReleaseMode".


1 Answers

In release mode debug printing will not be as explained on this link.

func debugPrint(format string, values ...interface{}) {
    if IsDebugging() {
        if !strings.HasSuffix(format, "\n") {
            format += "\n"
        }
        fmt.Fprintf(os.Stderr, "[GIN-debug] "+format, values...)
    }
}
like image 50
avivl Avatar answered Oct 24 '22 04:10

avivl