Fixing warnings

This commit is contained in:
Denis-Cosmin Nutiu 2017-10-29 15:01:45 +02:00
parent c676da9a30
commit 093b853785
3 changed files with 9 additions and 10 deletions

View file

@ -86,7 +86,7 @@ func ListFiles(c net.Conn) error {
} }
func ShowHelp(c net.Conn) error { func ShowHelp(c net.Conn) error {
var helpText string = ` var helpText = `
The available commands are: The available commands are:
get <filename> - Download the requested filename. get <filename> - Download the requested filename.
ls - List the files in the current directory. ls - List the files in the current directory.

View file

@ -14,15 +14,14 @@ func (e InputError) Error() string { return "Error: " + e.Op + ": " + e.Err.Erro
// Input Errors // Input Errors
var ( var (
InputUnknownError = errors.New("Unknown Error.") InputInvalidCommand = errors.New("invalid command")
InputInvalidCommand = errors.New("Invalid command.") InputTooManyArguments = errors.New("too many arguments")
InputTooManyArguments = errors.New("Too many arguments.") InputTooFewArguments = errors.New("too few arguments")
InputTooFewArguments = errors.New("Too few arguments.")
) )
// Command Errors represent errors that occur when the server is executing commands // Command Errors represent errors that occur when the server is executing commands
var ( var (
GetNoBitsError = errors.New("The file/directory contains zero bits!") GetNoBitsError = errors.New("the file/directory contains zero bits")
) )
type StackError struct { type StackError struct {
@ -34,7 +33,7 @@ func (e StackError) Error() string { return e.ErrorName + ": " + e.Err.Error() }
// Stack Errors // Stack Errors
var ( var (
StackInvalidTypeError = StackError{"InvalidTypeError", errors.New("Invalid item type for the Stack")} StackInvalidTypeError = StackError{"InvalidTypeError", errors.New("invalid item type for the Stack")}
StackOverflowError = StackError{"StackOverflowError", errors.New("Stack capacity exceeded!")} StackOverflowError = StackError{"StackOverflowError", errors.New("stack capacity exceeded")}
StackUnderflowError = StackError{"StackUnderflowError", errors.New("Stack is empty!")} StackUnderflowError = StackError{"StackUnderflowError", errors.New("stack is empty")}
) )

View file

@ -59,7 +59,7 @@ func ProcessInput(c net.Conn, text string) error {
// Ansi clear: 1b 5b 48 1b 5b 4a // Ansi clear: 1b 5b 48 1b 5b 4a
// clear | hexdump -C // clear | hexdump -C
var b []byte = []byte{0x1b, 0x5b, 0x48, 0x1b, 0x5b, 0x4a} var b = []byte{0x1b, 0x5b, 0x48, 0x1b, 0x5b, 0x4a}
c.Write(b) c.Write(b)
case "help": case "help":