github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/ssh/sshfakes/fake_secure_session.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package sshfakes 3 4 import ( 5 "io" 6 "sync" 7 8 sshCmd "code.cloudfoundry.org/cli/cf/ssh" 9 "golang.org/x/crypto/ssh" 10 ) 11 12 type FakeSecureSession struct { 13 CloseStub func() error 14 closeMutex sync.RWMutex 15 closeArgsForCall []struct { 16 } 17 closeReturns struct { 18 result1 error 19 } 20 closeReturnsOnCall map[int]struct { 21 result1 error 22 } 23 RequestPtyStub func(string, int, int, ssh.TerminalModes) error 24 requestPtyMutex sync.RWMutex 25 requestPtyArgsForCall []struct { 26 arg1 string 27 arg2 int 28 arg3 int 29 arg4 ssh.TerminalModes 30 } 31 requestPtyReturns struct { 32 result1 error 33 } 34 requestPtyReturnsOnCall map[int]struct { 35 result1 error 36 } 37 SendRequestStub func(string, bool, []byte) (bool, error) 38 sendRequestMutex sync.RWMutex 39 sendRequestArgsForCall []struct { 40 arg1 string 41 arg2 bool 42 arg3 []byte 43 } 44 sendRequestReturns struct { 45 result1 bool 46 result2 error 47 } 48 sendRequestReturnsOnCall map[int]struct { 49 result1 bool 50 result2 error 51 } 52 ShellStub func() error 53 shellMutex sync.RWMutex 54 shellArgsForCall []struct { 55 } 56 shellReturns struct { 57 result1 error 58 } 59 shellReturnsOnCall map[int]struct { 60 result1 error 61 } 62 StartStub func(string) error 63 startMutex sync.RWMutex 64 startArgsForCall []struct { 65 arg1 string 66 } 67 startReturns struct { 68 result1 error 69 } 70 startReturnsOnCall map[int]struct { 71 result1 error 72 } 73 StderrPipeStub func() (io.Reader, error) 74 stderrPipeMutex sync.RWMutex 75 stderrPipeArgsForCall []struct { 76 } 77 stderrPipeReturns struct { 78 result1 io.Reader 79 result2 error 80 } 81 stderrPipeReturnsOnCall map[int]struct { 82 result1 io.Reader 83 result2 error 84 } 85 StdinPipeStub func() (io.WriteCloser, error) 86 stdinPipeMutex sync.RWMutex 87 stdinPipeArgsForCall []struct { 88 } 89 stdinPipeReturns struct { 90 result1 io.WriteCloser 91 result2 error 92 } 93 stdinPipeReturnsOnCall map[int]struct { 94 result1 io.WriteCloser 95 result2 error 96 } 97 StdoutPipeStub func() (io.Reader, error) 98 stdoutPipeMutex sync.RWMutex 99 stdoutPipeArgsForCall []struct { 100 } 101 stdoutPipeReturns struct { 102 result1 io.Reader 103 result2 error 104 } 105 stdoutPipeReturnsOnCall map[int]struct { 106 result1 io.Reader 107 result2 error 108 } 109 WaitStub func() error 110 waitMutex sync.RWMutex 111 waitArgsForCall []struct { 112 } 113 waitReturns struct { 114 result1 error 115 } 116 waitReturnsOnCall map[int]struct { 117 result1 error 118 } 119 invocations map[string][][]interface{} 120 invocationsMutex sync.RWMutex 121 } 122 123 func (fake *FakeSecureSession) Close() error { 124 fake.closeMutex.Lock() 125 ret, specificReturn := fake.closeReturnsOnCall[len(fake.closeArgsForCall)] 126 fake.closeArgsForCall = append(fake.closeArgsForCall, struct { 127 }{}) 128 fake.recordInvocation("Close", []interface{}{}) 129 fake.closeMutex.Unlock() 130 if fake.CloseStub != nil { 131 return fake.CloseStub() 132 } 133 if specificReturn { 134 return ret.result1 135 } 136 fakeReturns := fake.closeReturns 137 return fakeReturns.result1 138 } 139 140 func (fake *FakeSecureSession) CloseCallCount() int { 141 fake.closeMutex.RLock() 142 defer fake.closeMutex.RUnlock() 143 return len(fake.closeArgsForCall) 144 } 145 146 func (fake *FakeSecureSession) CloseCalls(stub func() error) { 147 fake.closeMutex.Lock() 148 defer fake.closeMutex.Unlock() 149 fake.CloseStub = stub 150 } 151 152 func (fake *FakeSecureSession) CloseReturns(result1 error) { 153 fake.closeMutex.Lock() 154 defer fake.closeMutex.Unlock() 155 fake.CloseStub = nil 156 fake.closeReturns = struct { 157 result1 error 158 }{result1} 159 } 160 161 func (fake *FakeSecureSession) CloseReturnsOnCall(i int, result1 error) { 162 fake.closeMutex.Lock() 163 defer fake.closeMutex.Unlock() 164 fake.CloseStub = nil 165 if fake.closeReturnsOnCall == nil { 166 fake.closeReturnsOnCall = make(map[int]struct { 167 result1 error 168 }) 169 } 170 fake.closeReturnsOnCall[i] = struct { 171 result1 error 172 }{result1} 173 } 174 175 func (fake *FakeSecureSession) RequestPty(arg1 string, arg2 int, arg3 int, arg4 ssh.TerminalModes) error { 176 fake.requestPtyMutex.Lock() 177 ret, specificReturn := fake.requestPtyReturnsOnCall[len(fake.requestPtyArgsForCall)] 178 fake.requestPtyArgsForCall = append(fake.requestPtyArgsForCall, struct { 179 arg1 string 180 arg2 int 181 arg3 int 182 arg4 ssh.TerminalModes 183 }{arg1, arg2, arg3, arg4}) 184 fake.recordInvocation("RequestPty", []interface{}{arg1, arg2, arg3, arg4}) 185 fake.requestPtyMutex.Unlock() 186 if fake.RequestPtyStub != nil { 187 return fake.RequestPtyStub(arg1, arg2, arg3, arg4) 188 } 189 if specificReturn { 190 return ret.result1 191 } 192 fakeReturns := fake.requestPtyReturns 193 return fakeReturns.result1 194 } 195 196 func (fake *FakeSecureSession) RequestPtyCallCount() int { 197 fake.requestPtyMutex.RLock() 198 defer fake.requestPtyMutex.RUnlock() 199 return len(fake.requestPtyArgsForCall) 200 } 201 202 func (fake *FakeSecureSession) RequestPtyCalls(stub func(string, int, int, ssh.TerminalModes) error) { 203 fake.requestPtyMutex.Lock() 204 defer fake.requestPtyMutex.Unlock() 205 fake.RequestPtyStub = stub 206 } 207 208 func (fake *FakeSecureSession) RequestPtyArgsForCall(i int) (string, int, int, ssh.TerminalModes) { 209 fake.requestPtyMutex.RLock() 210 defer fake.requestPtyMutex.RUnlock() 211 argsForCall := fake.requestPtyArgsForCall[i] 212 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4 213 } 214 215 func (fake *FakeSecureSession) RequestPtyReturns(result1 error) { 216 fake.requestPtyMutex.Lock() 217 defer fake.requestPtyMutex.Unlock() 218 fake.RequestPtyStub = nil 219 fake.requestPtyReturns = struct { 220 result1 error 221 }{result1} 222 } 223 224 func (fake *FakeSecureSession) RequestPtyReturnsOnCall(i int, result1 error) { 225 fake.requestPtyMutex.Lock() 226 defer fake.requestPtyMutex.Unlock() 227 fake.RequestPtyStub = nil 228 if fake.requestPtyReturnsOnCall == nil { 229 fake.requestPtyReturnsOnCall = make(map[int]struct { 230 result1 error 231 }) 232 } 233 fake.requestPtyReturnsOnCall[i] = struct { 234 result1 error 235 }{result1} 236 } 237 238 func (fake *FakeSecureSession) SendRequest(arg1 string, arg2 bool, arg3 []byte) (bool, error) { 239 var arg3Copy []byte 240 if arg3 != nil { 241 arg3Copy = make([]byte, len(arg3)) 242 copy(arg3Copy, arg3) 243 } 244 fake.sendRequestMutex.Lock() 245 ret, specificReturn := fake.sendRequestReturnsOnCall[len(fake.sendRequestArgsForCall)] 246 fake.sendRequestArgsForCall = append(fake.sendRequestArgsForCall, struct { 247 arg1 string 248 arg2 bool 249 arg3 []byte 250 }{arg1, arg2, arg3Copy}) 251 fake.recordInvocation("SendRequest", []interface{}{arg1, arg2, arg3Copy}) 252 fake.sendRequestMutex.Unlock() 253 if fake.SendRequestStub != nil { 254 return fake.SendRequestStub(arg1, arg2, arg3) 255 } 256 if specificReturn { 257 return ret.result1, ret.result2 258 } 259 fakeReturns := fake.sendRequestReturns 260 return fakeReturns.result1, fakeReturns.result2 261 } 262 263 func (fake *FakeSecureSession) SendRequestCallCount() int { 264 fake.sendRequestMutex.RLock() 265 defer fake.sendRequestMutex.RUnlock() 266 return len(fake.sendRequestArgsForCall) 267 } 268 269 func (fake *FakeSecureSession) SendRequestCalls(stub func(string, bool, []byte) (bool, error)) { 270 fake.sendRequestMutex.Lock() 271 defer fake.sendRequestMutex.Unlock() 272 fake.SendRequestStub = stub 273 } 274 275 func (fake *FakeSecureSession) SendRequestArgsForCall(i int) (string, bool, []byte) { 276 fake.sendRequestMutex.RLock() 277 defer fake.sendRequestMutex.RUnlock() 278 argsForCall := fake.sendRequestArgsForCall[i] 279 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 280 } 281 282 func (fake *FakeSecureSession) SendRequestReturns(result1 bool, result2 error) { 283 fake.sendRequestMutex.Lock() 284 defer fake.sendRequestMutex.Unlock() 285 fake.SendRequestStub = nil 286 fake.sendRequestReturns = struct { 287 result1 bool 288 result2 error 289 }{result1, result2} 290 } 291 292 func (fake *FakeSecureSession) SendRequestReturnsOnCall(i int, result1 bool, result2 error) { 293 fake.sendRequestMutex.Lock() 294 defer fake.sendRequestMutex.Unlock() 295 fake.SendRequestStub = nil 296 if fake.sendRequestReturnsOnCall == nil { 297 fake.sendRequestReturnsOnCall = make(map[int]struct { 298 result1 bool 299 result2 error 300 }) 301 } 302 fake.sendRequestReturnsOnCall[i] = struct { 303 result1 bool 304 result2 error 305 }{result1, result2} 306 } 307 308 func (fake *FakeSecureSession) Shell() error { 309 fake.shellMutex.Lock() 310 ret, specificReturn := fake.shellReturnsOnCall[len(fake.shellArgsForCall)] 311 fake.shellArgsForCall = append(fake.shellArgsForCall, struct { 312 }{}) 313 fake.recordInvocation("Shell", []interface{}{}) 314 fake.shellMutex.Unlock() 315 if fake.ShellStub != nil { 316 return fake.ShellStub() 317 } 318 if specificReturn { 319 return ret.result1 320 } 321 fakeReturns := fake.shellReturns 322 return fakeReturns.result1 323 } 324 325 func (fake *FakeSecureSession) ShellCallCount() int { 326 fake.shellMutex.RLock() 327 defer fake.shellMutex.RUnlock() 328 return len(fake.shellArgsForCall) 329 } 330 331 func (fake *FakeSecureSession) ShellCalls(stub func() error) { 332 fake.shellMutex.Lock() 333 defer fake.shellMutex.Unlock() 334 fake.ShellStub = stub 335 } 336 337 func (fake *FakeSecureSession) ShellReturns(result1 error) { 338 fake.shellMutex.Lock() 339 defer fake.shellMutex.Unlock() 340 fake.ShellStub = nil 341 fake.shellReturns = struct { 342 result1 error 343 }{result1} 344 } 345 346 func (fake *FakeSecureSession) ShellReturnsOnCall(i int, result1 error) { 347 fake.shellMutex.Lock() 348 defer fake.shellMutex.Unlock() 349 fake.ShellStub = nil 350 if fake.shellReturnsOnCall == nil { 351 fake.shellReturnsOnCall = make(map[int]struct { 352 result1 error 353 }) 354 } 355 fake.shellReturnsOnCall[i] = struct { 356 result1 error 357 }{result1} 358 } 359 360 func (fake *FakeSecureSession) Start(arg1 string) error { 361 fake.startMutex.Lock() 362 ret, specificReturn := fake.startReturnsOnCall[len(fake.startArgsForCall)] 363 fake.startArgsForCall = append(fake.startArgsForCall, struct { 364 arg1 string 365 }{arg1}) 366 fake.recordInvocation("Start", []interface{}{arg1}) 367 fake.startMutex.Unlock() 368 if fake.StartStub != nil { 369 return fake.StartStub(arg1) 370 } 371 if specificReturn { 372 return ret.result1 373 } 374 fakeReturns := fake.startReturns 375 return fakeReturns.result1 376 } 377 378 func (fake *FakeSecureSession) StartCallCount() int { 379 fake.startMutex.RLock() 380 defer fake.startMutex.RUnlock() 381 return len(fake.startArgsForCall) 382 } 383 384 func (fake *FakeSecureSession) StartCalls(stub func(string) error) { 385 fake.startMutex.Lock() 386 defer fake.startMutex.Unlock() 387 fake.StartStub = stub 388 } 389 390 func (fake *FakeSecureSession) StartArgsForCall(i int) string { 391 fake.startMutex.RLock() 392 defer fake.startMutex.RUnlock() 393 argsForCall := fake.startArgsForCall[i] 394 return argsForCall.arg1 395 } 396 397 func (fake *FakeSecureSession) StartReturns(result1 error) { 398 fake.startMutex.Lock() 399 defer fake.startMutex.Unlock() 400 fake.StartStub = nil 401 fake.startReturns = struct { 402 result1 error 403 }{result1} 404 } 405 406 func (fake *FakeSecureSession) StartReturnsOnCall(i int, result1 error) { 407 fake.startMutex.Lock() 408 defer fake.startMutex.Unlock() 409 fake.StartStub = nil 410 if fake.startReturnsOnCall == nil { 411 fake.startReturnsOnCall = make(map[int]struct { 412 result1 error 413 }) 414 } 415 fake.startReturnsOnCall[i] = struct { 416 result1 error 417 }{result1} 418 } 419 420 func (fake *FakeSecureSession) StderrPipe() (io.Reader, error) { 421 fake.stderrPipeMutex.Lock() 422 ret, specificReturn := fake.stderrPipeReturnsOnCall[len(fake.stderrPipeArgsForCall)] 423 fake.stderrPipeArgsForCall = append(fake.stderrPipeArgsForCall, struct { 424 }{}) 425 fake.recordInvocation("StderrPipe", []interface{}{}) 426 fake.stderrPipeMutex.Unlock() 427 if fake.StderrPipeStub != nil { 428 return fake.StderrPipeStub() 429 } 430 if specificReturn { 431 return ret.result1, ret.result2 432 } 433 fakeReturns := fake.stderrPipeReturns 434 return fakeReturns.result1, fakeReturns.result2 435 } 436 437 func (fake *FakeSecureSession) StderrPipeCallCount() int { 438 fake.stderrPipeMutex.RLock() 439 defer fake.stderrPipeMutex.RUnlock() 440 return len(fake.stderrPipeArgsForCall) 441 } 442 443 func (fake *FakeSecureSession) StderrPipeCalls(stub func() (io.Reader, error)) { 444 fake.stderrPipeMutex.Lock() 445 defer fake.stderrPipeMutex.Unlock() 446 fake.StderrPipeStub = stub 447 } 448 449 func (fake *FakeSecureSession) StderrPipeReturns(result1 io.Reader, result2 error) { 450 fake.stderrPipeMutex.Lock() 451 defer fake.stderrPipeMutex.Unlock() 452 fake.StderrPipeStub = nil 453 fake.stderrPipeReturns = struct { 454 result1 io.Reader 455 result2 error 456 }{result1, result2} 457 } 458 459 func (fake *FakeSecureSession) StderrPipeReturnsOnCall(i int, result1 io.Reader, result2 error) { 460 fake.stderrPipeMutex.Lock() 461 defer fake.stderrPipeMutex.Unlock() 462 fake.StderrPipeStub = nil 463 if fake.stderrPipeReturnsOnCall == nil { 464 fake.stderrPipeReturnsOnCall = make(map[int]struct { 465 result1 io.Reader 466 result2 error 467 }) 468 } 469 fake.stderrPipeReturnsOnCall[i] = struct { 470 result1 io.Reader 471 result2 error 472 }{result1, result2} 473 } 474 475 func (fake *FakeSecureSession) StdinPipe() (io.WriteCloser, error) { 476 fake.stdinPipeMutex.Lock() 477 ret, specificReturn := fake.stdinPipeReturnsOnCall[len(fake.stdinPipeArgsForCall)] 478 fake.stdinPipeArgsForCall = append(fake.stdinPipeArgsForCall, struct { 479 }{}) 480 fake.recordInvocation("StdinPipe", []interface{}{}) 481 fake.stdinPipeMutex.Unlock() 482 if fake.StdinPipeStub != nil { 483 return fake.StdinPipeStub() 484 } 485 if specificReturn { 486 return ret.result1, ret.result2 487 } 488 fakeReturns := fake.stdinPipeReturns 489 return fakeReturns.result1, fakeReturns.result2 490 } 491 492 func (fake *FakeSecureSession) StdinPipeCallCount() int { 493 fake.stdinPipeMutex.RLock() 494 defer fake.stdinPipeMutex.RUnlock() 495 return len(fake.stdinPipeArgsForCall) 496 } 497 498 func (fake *FakeSecureSession) StdinPipeCalls(stub func() (io.WriteCloser, error)) { 499 fake.stdinPipeMutex.Lock() 500 defer fake.stdinPipeMutex.Unlock() 501 fake.StdinPipeStub = stub 502 } 503 504 func (fake *FakeSecureSession) StdinPipeReturns(result1 io.WriteCloser, result2 error) { 505 fake.stdinPipeMutex.Lock() 506 defer fake.stdinPipeMutex.Unlock() 507 fake.StdinPipeStub = nil 508 fake.stdinPipeReturns = struct { 509 result1 io.WriteCloser 510 result2 error 511 }{result1, result2} 512 } 513 514 func (fake *FakeSecureSession) StdinPipeReturnsOnCall(i int, result1 io.WriteCloser, result2 error) { 515 fake.stdinPipeMutex.Lock() 516 defer fake.stdinPipeMutex.Unlock() 517 fake.StdinPipeStub = nil 518 if fake.stdinPipeReturnsOnCall == nil { 519 fake.stdinPipeReturnsOnCall = make(map[int]struct { 520 result1 io.WriteCloser 521 result2 error 522 }) 523 } 524 fake.stdinPipeReturnsOnCall[i] = struct { 525 result1 io.WriteCloser 526 result2 error 527 }{result1, result2} 528 } 529 530 func (fake *FakeSecureSession) StdoutPipe() (io.Reader, error) { 531 fake.stdoutPipeMutex.Lock() 532 ret, specificReturn := fake.stdoutPipeReturnsOnCall[len(fake.stdoutPipeArgsForCall)] 533 fake.stdoutPipeArgsForCall = append(fake.stdoutPipeArgsForCall, struct { 534 }{}) 535 fake.recordInvocation("StdoutPipe", []interface{}{}) 536 fake.stdoutPipeMutex.Unlock() 537 if fake.StdoutPipeStub != nil { 538 return fake.StdoutPipeStub() 539 } 540 if specificReturn { 541 return ret.result1, ret.result2 542 } 543 fakeReturns := fake.stdoutPipeReturns 544 return fakeReturns.result1, fakeReturns.result2 545 } 546 547 func (fake *FakeSecureSession) StdoutPipeCallCount() int { 548 fake.stdoutPipeMutex.RLock() 549 defer fake.stdoutPipeMutex.RUnlock() 550 return len(fake.stdoutPipeArgsForCall) 551 } 552 553 func (fake *FakeSecureSession) StdoutPipeCalls(stub func() (io.Reader, error)) { 554 fake.stdoutPipeMutex.Lock() 555 defer fake.stdoutPipeMutex.Unlock() 556 fake.StdoutPipeStub = stub 557 } 558 559 func (fake *FakeSecureSession) StdoutPipeReturns(result1 io.Reader, result2 error) { 560 fake.stdoutPipeMutex.Lock() 561 defer fake.stdoutPipeMutex.Unlock() 562 fake.StdoutPipeStub = nil 563 fake.stdoutPipeReturns = struct { 564 result1 io.Reader 565 result2 error 566 }{result1, result2} 567 } 568 569 func (fake *FakeSecureSession) StdoutPipeReturnsOnCall(i int, result1 io.Reader, result2 error) { 570 fake.stdoutPipeMutex.Lock() 571 defer fake.stdoutPipeMutex.Unlock() 572 fake.StdoutPipeStub = nil 573 if fake.stdoutPipeReturnsOnCall == nil { 574 fake.stdoutPipeReturnsOnCall = make(map[int]struct { 575 result1 io.Reader 576 result2 error 577 }) 578 } 579 fake.stdoutPipeReturnsOnCall[i] = struct { 580 result1 io.Reader 581 result2 error 582 }{result1, result2} 583 } 584 585 func (fake *FakeSecureSession) Wait() error { 586 fake.waitMutex.Lock() 587 ret, specificReturn := fake.waitReturnsOnCall[len(fake.waitArgsForCall)] 588 fake.waitArgsForCall = append(fake.waitArgsForCall, struct { 589 }{}) 590 fake.recordInvocation("Wait", []interface{}{}) 591 fake.waitMutex.Unlock() 592 if fake.WaitStub != nil { 593 return fake.WaitStub() 594 } 595 if specificReturn { 596 return ret.result1 597 } 598 fakeReturns := fake.waitReturns 599 return fakeReturns.result1 600 } 601 602 func (fake *FakeSecureSession) WaitCallCount() int { 603 fake.waitMutex.RLock() 604 defer fake.waitMutex.RUnlock() 605 return len(fake.waitArgsForCall) 606 } 607 608 func (fake *FakeSecureSession) WaitCalls(stub func() error) { 609 fake.waitMutex.Lock() 610 defer fake.waitMutex.Unlock() 611 fake.WaitStub = stub 612 } 613 614 func (fake *FakeSecureSession) WaitReturns(result1 error) { 615 fake.waitMutex.Lock() 616 defer fake.waitMutex.Unlock() 617 fake.WaitStub = nil 618 fake.waitReturns = struct { 619 result1 error 620 }{result1} 621 } 622 623 func (fake *FakeSecureSession) WaitReturnsOnCall(i int, result1 error) { 624 fake.waitMutex.Lock() 625 defer fake.waitMutex.Unlock() 626 fake.WaitStub = nil 627 if fake.waitReturnsOnCall == nil { 628 fake.waitReturnsOnCall = make(map[int]struct { 629 result1 error 630 }) 631 } 632 fake.waitReturnsOnCall[i] = struct { 633 result1 error 634 }{result1} 635 } 636 637 func (fake *FakeSecureSession) Invocations() map[string][][]interface{} { 638 fake.invocationsMutex.RLock() 639 defer fake.invocationsMutex.RUnlock() 640 fake.closeMutex.RLock() 641 defer fake.closeMutex.RUnlock() 642 fake.requestPtyMutex.RLock() 643 defer fake.requestPtyMutex.RUnlock() 644 fake.sendRequestMutex.RLock() 645 defer fake.sendRequestMutex.RUnlock() 646 fake.shellMutex.RLock() 647 defer fake.shellMutex.RUnlock() 648 fake.startMutex.RLock() 649 defer fake.startMutex.RUnlock() 650 fake.stderrPipeMutex.RLock() 651 defer fake.stderrPipeMutex.RUnlock() 652 fake.stdinPipeMutex.RLock() 653 defer fake.stdinPipeMutex.RUnlock() 654 fake.stdoutPipeMutex.RLock() 655 defer fake.stdoutPipeMutex.RUnlock() 656 fake.waitMutex.RLock() 657 defer fake.waitMutex.RUnlock() 658 copiedInvocations := map[string][][]interface{}{} 659 for key, value := range fake.invocations { 660 copiedInvocations[key] = value 661 } 662 return copiedInvocations 663 } 664 665 func (fake *FakeSecureSession) recordInvocation(key string, args []interface{}) { 666 fake.invocationsMutex.Lock() 667 defer fake.invocationsMutex.Unlock() 668 if fake.invocations == nil { 669 fake.invocations = map[string][][]interface{}{} 670 } 671 if fake.invocations[key] == nil { 672 fake.invocations[key] = [][]interface{}{} 673 } 674 fake.invocations[key] = append(fake.invocations[key], args) 675 } 676 677 var _ sshCmd.SecureSession = new(FakeSecureSession)