-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: don't print log when testing (#311)
- Loading branch information
1 parent
aabc056
commit 21ed798
Showing
4 changed files
with
67 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package swag | ||
|
||
import ( | ||
"log" | ||
) | ||
|
||
const ( | ||
test = iota | ||
release | ||
) | ||
|
||
var swagMode = release | ||
|
||
func isRelease() bool { | ||
return swagMode == release | ||
} | ||
|
||
//Println calls Output to print to the standard logger when release mode. | ||
func Println(v ...interface{}) { | ||
if isRelease() { | ||
log.Println(v...) | ||
} | ||
} | ||
|
||
//Printf calls Output to print to the standard logger when release mode. | ||
func Printf(format string, v ...interface{}) { | ||
if isRelease() { | ||
log.Printf(format, v...) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters