Improved variable lifetime tracking
This commit is contained in:
parent
1510f88165
commit
b8c011d742
17 changed files with 114 additions and 31 deletions
13
src/errors/UnusedVariable.go
Normal file
13
src/errors/UnusedVariable.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package errors
|
||||
|
||||
import "fmt"
|
||||
|
||||
// UnusedVariable error is created when a defined variable is never used.
|
||||
type UnusedVariable struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
// Error generates the string representation.
|
||||
func (err *UnusedVariable) Error() string {
|
||||
return fmt.Sprintf("Unused variable '%s'", err.Name)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue