MCPcopy Create free account
hub / github.com/celzero/midway / Sudo

Function Sudo

midway/env/util.go:49–56  ·  view source on GitHub ↗

ref: stackoverflow.com/a/66624820

()

Source from the content-addressed store, hash-verified

47
48// ref: stackoverflow.com/a/66624820
49func Sudo() bool {
50 if u, err := user.Current(); err != nil {
51 log.Print("Unable to get cur-user: %s", err)
52 return false
53 } else {
54 return u.Username == "root"
55 }
56}
57
58func Mtu() int {
59 // mtu on fly is 1420

Callers 1

mainFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected