From f2423bd71a30a7dfc44319ae287f9fad514f6465 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 21 Nov 2019 22:35:00 +0100 Subject: [PATCH] make internal/multipart use internal/cerr constant errors - instead of defining its own --- internal/multipart/types.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/internal/multipart/types.go b/internal/multipart/types.go index 6860af4..86fda25 100644 --- a/internal/multipart/types.go +++ b/internal/multipart/types.go @@ -1,21 +1,15 @@ package multipart -// ConstError is a wrapper to set constant errors -type ConstError string - -// Error implements error -func (err ConstError) Error() string { - return string(err) -} +import "git.xdrm.io/go/aicra/internal/cerr" // ErrMissingDataName is set when a multipart variable/file has no name="..." -const ErrMissingDataName = ConstError("data has no name") +const ErrMissingDataName = cerr.Error("data has no name") // ErrDataNameConflict is set when a multipart variable/file name is already used -const ErrDataNameConflict = ConstError("data name conflict") +const ErrDataNameConflict = cerr.Error("data name conflict") // ErrNoHeader is set when a multipart variable/file has no (valid) header -const ErrNoHeader = ConstError("data has no header") +const ErrNoHeader = cerr.Error("data has no header") // Component represents a multipart variable/file type Component struct {