Merge pull request #366 from drakkan/simplify

remove redundant types declaration
This commit is contained in:
Cassondra Foesch 2020-07-25 10:47:09 +00:00 committed by GitHub
commit f129610309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 23 deletions

View File

@ -53,34 +53,34 @@ type orderedPair struct {
// basic test
var ttable1 = []pair{
pair{fake(0, 0), fake(0, 0)},
pair{fake(1, 1), fake(1, 1)},
pair{fake(2, 2), fake(2, 2)},
pair{fake(3, 3), fake(3, 3)},
{fake(0, 0), fake(0, 0)},
{fake(1, 1), fake(1, 1)},
{fake(2, 2), fake(2, 2)},
{fake(3, 3), fake(3, 3)},
}
// outgoing packets out of order
var ttable2 = []pair{
pair{fake(10, 0), fake(12, 2)},
pair{fake(11, 1), fake(11, 1)},
pair{fake(12, 2), fake(13, 3)},
pair{fake(13, 3), fake(10, 0)},
{fake(10, 0), fake(12, 2)},
{fake(11, 1), fake(11, 1)},
{fake(12, 2), fake(13, 3)},
{fake(13, 3), fake(10, 0)},
}
// request ids are not incremental
var ttable3 = []pair{
pair{fake(7, 0), fake(7, 0)},
pair{fake(1, 1), fake(1, 1)},
pair{fake(9, 2), fake(3, 3)},
pair{fake(3, 3), fake(9, 2)},
{fake(7, 0), fake(7, 0)},
{fake(1, 1), fake(1, 1)},
{fake(9, 2), fake(3, 3)},
{fake(3, 3), fake(9, 2)},
}
// request ids are all the same
var ttable4 = []pair{
pair{fake(1, 0), fake(1, 0)},
pair{fake(1, 1), fake(1, 1)},
pair{fake(1, 2), fake(1, 3)},
pair{fake(1, 3), fake(1, 2)},
{fake(1, 0), fake(1, 0)},
{fake(1, 1), fake(1, 1)},
{fake(1, 2), fake(1, 3)},
{fake(1, 3), fake(1, 2)},
}
var tables = [][]pair{ttable1, ttable2, ttable3, ttable4}

View File

@ -281,14 +281,14 @@ func TestStatusFromError(t *testing.T) {
}
}
testCases := []test{
test{syscall.ENOENT, tpkt(1, sshFxNoSuchFile)},
test{&os.PathError{Err: syscall.ENOENT},
{syscall.ENOENT, tpkt(1, sshFxNoSuchFile)},
{&os.PathError{Err: syscall.ENOENT},
tpkt(2, sshFxNoSuchFile)},
test{&os.PathError{Err: errors.New("foo")}, tpkt(3, sshFxFailure)},
test{ErrSSHFxEOF, tpkt(4, sshFxEOF)},
test{ErrSSHFxOpUnsupported, tpkt(5, sshFxOPUnsupported)},
test{io.EOF, tpkt(6, sshFxEOF)},
test{os.ErrNotExist, tpkt(7, sshFxNoSuchFile)},
{&os.PathError{Err: errors.New("foo")}, tpkt(3, sshFxFailure)},
{ErrSSHFxEOF, tpkt(4, sshFxEOF)},
{ErrSSHFxOpUnsupported, tpkt(5, sshFxOPUnsupported)},
{io.EOF, tpkt(6, sshFxEOF)},
{os.ErrNotExist, tpkt(7, sshFxNoSuchFile)},
}
for _, tc := range testCases {
tc.pkt.StatusError.msg = tc.err.Error()