gofmt
This commit is contained in:
parent
872a244347
commit
acaf7edcbc
@ -76,7 +76,7 @@ func TestConn(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
} else {
|
} else {
|
||||||
if dir != "/" + testDir {
|
if dir != "/"+testDir {
|
||||||
t.Error("Wrong dir: " + dir)
|
t.Error("Wrong dir: " + dir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ type line struct {
|
|||||||
entryType EntryType
|
entryType EntryType
|
||||||
}
|
}
|
||||||
|
|
||||||
var listTests = []line {
|
var listTests = []line{
|
||||||
// UNIX ls -l style
|
// UNIX ls -l style
|
||||||
line{"drwxr-xr-x 3 110 1002 3 Dec 02 2009 pub", "pub", 0, EntryTypeFolder},
|
line{"drwxr-xr-x 3 110 1002 3 Dec 02 2009 pub", "pub", 0, EntryTypeFolder},
|
||||||
line{"drwxr-xr-x 3 110 1002 3 Dec 02 2009 p u b", "p u b", 0, EntryTypeFolder},
|
line{"drwxr-xr-x 3 110 1002 3 Dec 02 2009 p u b", "p u b", 0, EntryTypeFolder},
|
||||||
@ -23,7 +23,7 @@ var listTests = []line {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Not supported, at least we should properly return failure
|
// Not supported, at least we should properly return failure
|
||||||
var listTestsFail = []line {
|
var listTestsFail = []line{
|
||||||
line{"d [R----F--] supervisor 512 Jan 16 18:53 login", "login", 0, EntryTypeFolder},
|
line{"d [R----F--] supervisor 512 Jan 16 18:53 login", "login", 0, EntryTypeFolder},
|
||||||
line{"- [R----F--] rhesus 214059 Oct 20 15:27 cx.exe", "cx.exe", 0, EntryTypeFile},
|
line{"- [R----F--] rhesus 214059 Oct 20 15:27 cx.exe", "cx.exe", 0, EntryTypeFile},
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ func TestParseListLine(t *testing.T) {
|
|||||||
t.Errorf("parseListLine(%v).Name = '%v', want '%v'", lt.line, entry.Name, lt.name)
|
t.Errorf("parseListLine(%v).Name = '%v', want '%v'", lt.line, entry.Name, lt.name)
|
||||||
}
|
}
|
||||||
if entry.Type != lt.entryType {
|
if entry.Type != lt.entryType {
|
||||||
t.Errorf("parseListLine(%v).EntryType = %v, want %v", lt.line, entry.Type, lt.entryType,)
|
t.Errorf("parseListLine(%v).EntryType = %v, want %v", lt.line, entry.Type, lt.entryType)
|
||||||
}
|
}
|
||||||
if entry.Size != lt.size {
|
if entry.Size != lt.size {
|
||||||
t.Errorf("parseListLine(%v).Size = %v, want %v", lt.line, entry.Size, lt.size)
|
t.Errorf("parseListLine(%v).Size = %v, want %v", lt.line, entry.Size, lt.size)
|
||||||
|
@ -7,6 +7,7 @@ const (
|
|||||||
StatusReadyMinute = 120
|
StatusReadyMinute = 120
|
||||||
StatusAlreadyOpen = 125
|
StatusAlreadyOpen = 125
|
||||||
StatusAboutToSend = 150
|
StatusAboutToSend = 150
|
||||||
|
|
||||||
// Positive Completion reply
|
// Positive Completion reply
|
||||||
StatusCommandOK = 200
|
StatusCommandOK = 200
|
||||||
StatusCommandNotImplemented = 202
|
StatusCommandNotImplemented = 202
|
||||||
@ -27,10 +28,12 @@ const (
|
|||||||
StatusLogoutAck = 232
|
StatusLogoutAck = 232
|
||||||
StatusRequestedFileActionOK = 250
|
StatusRequestedFileActionOK = 250
|
||||||
StatusPathCreated = 257
|
StatusPathCreated = 257
|
||||||
|
|
||||||
// Positive Intermediate reply
|
// Positive Intermediate reply
|
||||||
StatusUserOK = 331
|
StatusUserOK = 331
|
||||||
StatusLoginNeedAccount = 332
|
StatusLoginNeedAccount = 332
|
||||||
StatusRequestFilePending = 350
|
StatusRequestFilePending = 350
|
||||||
|
|
||||||
// Transient Negative Completion reply
|
// Transient Negative Completion reply
|
||||||
StatusNotAvailable = 421
|
StatusNotAvailable = 421
|
||||||
StatusCanNotOpenDataConnection = 425
|
StatusCanNotOpenDataConnection = 425
|
||||||
@ -40,6 +43,7 @@ const (
|
|||||||
StatusFileActionIgnored = 450
|
StatusFileActionIgnored = 450
|
||||||
StatusActionAborted = 451
|
StatusActionAborted = 451
|
||||||
Status452 = 452
|
Status452 = 452
|
||||||
|
|
||||||
// Permanent Negative Completion reply
|
// Permanent Negative Completion reply
|
||||||
StatusBadCommand = 500
|
StatusBadCommand = 500
|
||||||
StatusBadArguments = 501
|
StatusBadArguments = 501
|
||||||
@ -75,10 +79,12 @@ var statusText = map[int]string{
|
|||||||
StatusLogoutAck: "Logout command noted, will complete when transfer done.",
|
StatusLogoutAck: "Logout command noted, will complete when transfer done.",
|
||||||
StatusRequestedFileActionOK: "Requested file action okay, completed.",
|
StatusRequestedFileActionOK: "Requested file action okay, completed.",
|
||||||
StatusPathCreated: "Path created.",
|
StatusPathCreated: "Path created.",
|
||||||
|
|
||||||
// 300
|
// 300
|
||||||
StatusUserOK: "User name okay, need password.",
|
StatusUserOK: "User name okay, need password.",
|
||||||
StatusLoginNeedAccount: "Need account for login.",
|
StatusLoginNeedAccount: "Need account for login.",
|
||||||
StatusRequestFilePending: "Requested file action pending further information.",
|
StatusRequestFilePending: "Requested file action pending further information.",
|
||||||
|
|
||||||
// 400
|
// 400
|
||||||
StatusNotAvailable: "Service not available, closing control connection.",
|
StatusNotAvailable: "Service not available, closing control connection.",
|
||||||
StatusCanNotOpenDataConnection: "Can't open data connection.",
|
StatusCanNotOpenDataConnection: "Can't open data connection.",
|
||||||
@ -88,6 +94,7 @@ var statusText = map[int]string{
|
|||||||
StatusFileActionIgnored: "Requested file action not taken.",
|
StatusFileActionIgnored: "Requested file action not taken.",
|
||||||
StatusActionAborted: "Requested action aborted. Local error in processing.",
|
StatusActionAborted: "Requested action aborted. Local error in processing.",
|
||||||
Status452: "Insufficient storage space in system.",
|
Status452: "Insufficient storage space in system.",
|
||||||
|
|
||||||
// 500
|
// 500
|
||||||
StatusBadCommand: "Command unrecognized.",
|
StatusBadCommand: "Command unrecognized.",
|
||||||
StatusBadArguments: "Syntax error in parameters or arguments.",
|
StatusBadArguments: "Syntax error in parameters or arguments.",
|
||||||
|
Loading…
Reference in New Issue
Block a user