MCPcopy Index your code
hub / github.com/getlantern/sysproxy / verify

Function verify

sysproxy.go:136–148  ·  view source on GitHub ↗
(expected string)

Source from the content-addressed store, hash-verified

134}
135
136func verify(expected string) error {
137 cmd := be.Command("show")
138 out, err := cmd.Output()
139 if err != nil {
140 return err
141 }
142 actual := string(out)
143 log.Debugf("Command %v output %v", cmd.Path, actual)
144 if !allEquals(expected, actual) {
145 return fmt.Errorf("unexpected output: expect '%s', got '%s'", expected, actual)
146 }
147 return nil
148}
149
150func allEquals(expected string, actual string) bool {
151 if (expected == "") != (strings.TrimSpace(actual) == "") { // XOR

Callers 3

OnFunction · 0.85
OffFunction · 0.85
waitAndCleanupFunction · 0.85

Calls 1

allEqualsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…