You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
197 B
Go

8 months ago
package utils
import (
"errors"
"strings"
)
func SubstrError(err error) (sErr error) {
start := strings.Index(err.Error(), ":")
msg := err.Error()[start+2:]
sErr = errors.New(msg)
return
}