1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Change the errors.New() with fmt.Errof

This commit is contained in:
creack 2013-03-15 03:58:43 -07:00
parent 137af244ee
commit b2cf5041cd
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,6 @@
package fs
import (
"errors"
"fmt"
"github.com/dotcloud/docker/fake"
"github.com/dotcloud/docker/future"
@ -261,7 +260,7 @@ func healthCheck(store *Store) error {
for _, img := range images {
// Check for duplicate IDs per path
if _, exists := IDs[img.Id]; exists {
return errors.New(fmt.Sprintf("Duplicate ID: %s", img.Id))
return fmt.Errorf("Duplicate ID: %s", img.Id)
} else {
IDs[img.Id] = true
}
@ -274,7 +273,7 @@ func healthCheck(store *Store) error {
// Check non-existing parents
for parent := range parents {
if _, exists := parents[parent]; !exists {
return errors.New("Reference to non-registered parent: " + parent)
return fmt.Errorf("Reference to non-registered parent: %s", parent)
}
}
return nil

View file

@ -1,6 +1,7 @@
package docker
import (
"fmt"
"github.com/dotcloud/docker/fake"
"github.com/dotcloud/docker/fs"
"io/ioutil"
@ -9,7 +10,7 @@ import (
)
// Look for inconsistencies in a store.
func healthCheck(store *Store) error {
func healthCheck(store *fs.Store) error {
parents := make(map[string]bool)
paths, err := store.Paths()
if err != nil {
@ -24,7 +25,7 @@ func healthCheck(store *Store) error {
for _, img := range images {
// Check for duplicate IDs per path
if _, exists := IDs[img.Id]; exists {
return errors.New(fmt.Sprintf("Duplicate ID: %s", img.Id))
return fmt.Errorf("Duplicate ID: %s", img.Id)
} else {
IDs[img.Id] = true
}
@ -37,7 +38,7 @@ func healthCheck(store *Store) error {
// Check non-existing parents
for parent := range parents {
if _, exists := parents[parent]; !exists {
return errors.New("Reference to non-registered parent: " + parent)
return fmt.Errorf("Reference to non-registered parent: %s", parent)
}
}
return nil