Files
docker-cli/components/engine/image/image.go
John Howard 1296feade8 Windows: Graph driver implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 52f4d09ffb376ffaa6677cb1e0413c6a97f53f24
Component: engine
2015-07-10 14:33:11 -07:00

17 lines
293 B
Go

package image
import (
"fmt"
"regexp"
)
var validHex = regexp.MustCompile(`^([a-f0-9]{64})$`)
// Check wheather id is a valid image ID or not
func ValidateID(id string) error {
if ok := validHex.MatchString(id); !ok {
return fmt.Errorf("image ID '%s' is invalid", id)
}
return nil
}