From 22d1476bbaf749f70b78cb708771f8eeb17d7ae9 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Thu, 23 Apr 2020 14:27:50 -0400 Subject: [PATCH] util: create a NewErrSnapNameConflict function The NewErrSnapNameConflict will allow packages outside of "util" to create new instances of the ErrSnapNameConflict error. Signed-off-by: John Mulligan --- internal/util/errors.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/util/errors.go b/internal/util/errors.go index ca15c5768..4013d55e9 100644 --- a/internal/util/errors.go +++ b/internal/util/errors.go @@ -57,6 +57,10 @@ func (e ErrSnapNameConflict) Error() string { return e.err.Error() } +func NewErrSnapNameConflict(name string, err error) ErrSnapNameConflict { + return ErrSnapNameConflict{name, err} +} + // ErrPoolNotFound is returned when pool is not found type ErrPoolNotFound struct { Pool string