MCPcopy
hub / github.com/tailscale/tailscale / Output

Method Output

tempfork/sshtest/ssh/session.go:318–326  ·  view source on GitHub ↗

Output runs cmd on the remote host and returns its standard output.

(cmd string)

Source from the content-addressed store, hash-verified

316
317// Output runs cmd on the remote host and returns its standard output.
318func (s *Session) Output(cmd string) ([]byte, error) {
319 if s.Stdout != nil {
320 return nil, errors.New("ssh: Stdout already set")
321 }
322 var b bytes.Buffer
323 s.Stdout = &b
324 err := s.Run(cmd)
325 return b.Bytes(), err
326}
327
328type singleWriter struct {
329 b bytes.Buffer

Callers 15

TestListenSSHFunction · 0.95
TestSessionOutputFunction · 0.95
testDistroMethod · 0.95
TestGoVersionFunction · 0.45
goEnvFunction · 0.45
installFreedesktopFunction · 0.45
installIconFunction · 0.45
tailscaledConnectHintFunction · 0.45
gitRootDirFunction · 0.45
freebsdVersionMetaFunction · 0.45
IsSELinuxEnforcingFunction · 0.45
readMacosSameUserProofFunction · 0.45

Calls 3

RunMethod · 0.95
BytesMethod · 0.80
NewMethod · 0.45

Tested by 13

TestListenSSHFunction · 0.76
TestSessionOutputFunction · 0.76
testDistroMethod · 0.76
TestGoVersionFunction · 0.36
goEnvFunction · 0.36
TestSyncedToUpstreamFunction · 0.36
buildTestWrapperFunction · 0.36
TestUsedConsistentlyFunction · 0.36
TestGocrossWrapperFunction · 0.36
TestGocrossWrapperFunction · 0.36