MCPcopy
hub / github.com/tailscale/tailscale / Run

Method Run

tempfork/sshtest/ssh/session.go:309–315  ·  view source on GitHub ↗

Run runs cmd on the remote host. Typically, the remote server passes cmd to the shell for interpretation. A Session only accepts one call to Run, Start, Shell, Output, or CombinedOutput. The returned error is nil if the command runs, has no problems copying stdin, stdout, and stderr, and exits with

(cmd string)

Source from the content-addressed store, hash-verified

307// unsuccessfully or is interrupted by a signal, the error is of type
308// *ExitError. Other error types may be returned for I/O problems.
309func (s *Session) Run(cmd string) error {
310 err := s.Start(cmd)
311 if err != nil {
312 return err
313 }
314 return s.Wait()
315}
316
317// Output runs cmd on the remote host and returns its standard output.
318func (s *Session) Output(cmd string) ([]byte, error) {

Callers 5

OutputMethod · 0.95
CombinedOutputMethod · 0.95
ExampleDialFunction · 0.95
testDistroMethod · 0.95
runTestCommandsFunction · 0.95

Calls 2

StartMethod · 0.95
WaitMethod · 0.95

Tested by 3

ExampleDialFunction · 0.76
testDistroMethod · 0.76
runTestCommandsFunction · 0.76