...
Source file
src/runtime/security_unix.go
Documentation: runtime
1
2
3
4
5
6
7 package runtime
8
9 func secure() {
10 initSecureMode()
11
12 if !isSecureMode() {
13 return
14 }
15
16
17
18
19
20
21
22 secureEnv()
23 }
24
25 func secureEnv() {
26 var hasTraceback bool
27 for i := 0; i < len(envs); i++ {
28 if hasPrefix(envs[i], "GOTRACEBACK=") {
29 hasTraceback = true
30 envs[i] = "GOTRACEBACK=none"
31 }
32 }
33 if !hasTraceback {
34 envs = append(envs, "GOTRACEBACK=none")
35 }
36 }
37
View as plain text