How to properly use build tags?

后端 未结 2 1428
甜味超标
甜味超标 2021-02-01 03:56

I need to be able to build different versions of a go application; a \'debug\' version and a normal version.

This is easy to do; I simply have a const DEBUG, that contro

2条回答
  •  别跟我提以往
    2021-02-01 04:42

    See my answer to another question. You need a blank line after the "// +build" line.

    Also, you probably want the "!" in config.go, not in config.debug.go; and presumably you want one to be "DEBUG = false".

提交回复
热议问题