| 1 | package ssh_configscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/ |
| 2 | |
| 3 | import ( |
| 4 | "errorsscip-go gomod github.com/golang/go/src go1.18 errors/" |
| 5 | "testingscip-go gomod github.com/golang/go/src go1.18 testing/" |
| 6 | ) |
| 7 | |
| 8 | type errReaderscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/errReader# struct { |
| 9 | } |
| 10 | |
| 11 | func (b *errReaderscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/errReader#) Readscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/errReader#Read().(p []byte) (n int, err error) { |
| 12 | return 0, errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Newscip-go gomod github.com/golang/go/src go1.18 errors/New().("read error occurred") |
| 13 | } |
| 14 | |
| 15 | func TestIOErrorscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/TestIOError().(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) { |
| 16 | buf := &errReaderscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/errReader#{} |
| 17 | _, err := Decodescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Decode().(buf, false) |
| 18 | if err == nil { |
| 19 | t.Fatalscip-go gomod github.com/golang/go/src go1.18 testing/common#Fatal().("expected non-nil err, got nil") |
| 20 | } |
| 21 | if err.Error() != "read error occurred" { |
| 22 | t.Errorfscip-go gomod github.com/golang/go/src go1.18 testing/common#Errorf().("expected read error msg, got %v", err) |
| 23 | } |
| 24 | } |