Skip to content

Commit

Permalink
feat: add error to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
charlires committed May 3, 2022
1 parent 5dfc4cf commit 0a3a6c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions miutil/util.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package miutil

import (
"fmt"
"log"
"regexp"
)
Expand All @@ -13,6 +14,10 @@ func OnlyNumbers(s string) string {
return reg.ReplaceAllString(s, "")
}

func NewError(cause, err error) error {
return fmt.Errorf("err: %w cause: %v", err, cause)
}

func NilString(s *string) string {
if s != nil {
return *s
Expand Down

0 comments on commit 0a3a6c1

Please sign in to comment.