Fix go vet warnings
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
14396c9092
commit
b4d2f061be
1 changed files with 13 additions and 10 deletions
|
@ -31,6 +31,18 @@ const (
|
||||||
ChangeDelete
|
ChangeDelete
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (c ChangeType) String() string {
|
||||||
|
switch c {
|
||||||
|
case ChangeModify:
|
||||||
|
return "C"
|
||||||
|
case ChangeAdd:
|
||||||
|
return "A"
|
||||||
|
case ChangeDelete:
|
||||||
|
return "D"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// Change represents a change, it wraps the change type and path.
|
// Change represents a change, it wraps the change type and path.
|
||||||
// It describes changes of the files in the path respect to the
|
// It describes changes of the files in the path respect to the
|
||||||
// parent layers. The change could be modify, add, delete.
|
// parent layers. The change could be modify, add, delete.
|
||||||
|
@ -41,16 +53,7 @@ type Change struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (change *Change) String() string {
|
func (change *Change) String() string {
|
||||||
var kind string
|
return fmt.Sprintf("%s %s", change.Kind, change.Path)
|
||||||
switch change.Kind {
|
|
||||||
case ChangeModify:
|
|
||||||
kind = "C"
|
|
||||||
case ChangeAdd:
|
|
||||||
kind = "A"
|
|
||||||
case ChangeDelete:
|
|
||||||
kind = "D"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("%s %s", kind, change.Path)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// for sort.Sort
|
// for sort.Sort
|
||||||
|
|
Loading…
Reference in a new issue