Simpilify configuration files

This commit is contained in:
V2Ray
2015-10-06 23:11:08 +02:00
parent 78daf8a879
commit 72b4eeba8b
27 changed files with 251 additions and 208 deletions
+4 -1
View File
@@ -22,7 +22,10 @@ func NewSubject(assert *Assertion) *Subject {
// decorate prefixes the string with the file and line of the call site
// and inserts the final newline if needed and indentation tabs for formatting.
func decorate(s string) string {
_, file, line, ok := runtime.Caller(4) // decorate + log + public function.
_, file, line, ok := runtime.Caller(3)
if strings.Contains(file, "testing") {
_, file, line, ok = runtime.Caller(4)
}
if ok {
// Truncate file name at last file name separator.
if index := strings.LastIndex(file, "/"); index >= 0 {