mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-16 04:34:37 +00:00
Enhancements to Revel command
Reformat of code Allow user to use a mix of command line arguments and flags Enhance the import tool to detect missing packages in the modules side Added test cases for all commands
This commit is contained in:
@@ -7,15 +7,22 @@ import (
|
||||
)
|
||||
|
||||
// The error is a wrapper for the
|
||||
type Error struct {
|
||||
SourceType string // The type of source that failed to build.
|
||||
Title, Path, Description string // Description of the error, as presented to the user.
|
||||
Line, Column int // Where the error was encountered.
|
||||
SourceLines []string // The entire source file, split into lines.
|
||||
Stack string // The raw stack trace string from debug.Stack().
|
||||
MetaError string // Error that occurred producing the error page.
|
||||
Link string // A configurable link to wrap the error source in
|
||||
}
|
||||
type (
|
||||
Error struct {
|
||||
SourceType string // The type of source that failed to build.
|
||||
Title, Path, Description string // Description of the error, as presented to the user.
|
||||
Line, Column int // Where the error was encountered.
|
||||
SourceLines []string // The entire source file, split into lines.
|
||||
Stack string // The raw stack trace string from debug.Stack().
|
||||
MetaError string // Error that occurred producing the error page.
|
||||
Link string // A configurable link to wrap the error source in
|
||||
}
|
||||
SourceLine struct {
|
||||
Source string
|
||||
Line int
|
||||
IsError bool
|
||||
}
|
||||
)
|
||||
|
||||
// Creates a link based on the configuration setting "errors.link"
|
||||
func (e *Error) SetLink(errorLink string) {
|
||||
@@ -50,6 +57,7 @@ func (e *Error) Error() string {
|
||||
}
|
||||
return fmt.Sprintf("%s%s", header, e.Description)
|
||||
}
|
||||
|
||||
// ContextSource method returns a snippet of the source around
|
||||
// where the error occurred.
|
||||
func (e *Error) ContextSource() []SourceLine {
|
||||
@@ -72,10 +80,3 @@ func (e *Error) ContextSource() []SourceLine {
|
||||
}
|
||||
return lines
|
||||
}
|
||||
|
||||
// SourceLine structure to hold the per-source-line details.
|
||||
type SourceLine struct {
|
||||
Source string
|
||||
Line int
|
||||
IsError bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user