MCPcopy
hub / github.com/dgraph-io/dgraph / Open

Function Open

contrib/jepsen/browser/browser.go:44–52  ·  view source on GitHub ↗

Open tries to open url in a browser and reports whether it succeeded.

(url string)

Source from the content-addressed store, hash-verified

42
43// Open tries to open url in a browser and reports whether it succeeded.
44func Open(url string) bool {
45 for _, args := range Commands() {
46 cmd := exec.Command(args[0], append(args[1:], url)...)
47 if cmd.Start() == nil && appearsSuccessful(cmd, 3*time.Second) {
48 return true
49 }
50 }
51 return false
52}
53
54// appearsSuccessful reports whether the command appears to have run successfully.
55// If the command runs longer than the timeout, it's deemed successful.

Callers 1

mainFunction · 0.92

Calls 3

CommandsFunction · 0.85
appearsSuccessfulFunction · 0.85
StartMethod · 0.65

Tested by

no test coverage detected