mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-23 09:52:01 +01:00
v0.5: (BREAKING) simplified config format, improved output formatting, fixed docker watcher
This commit is contained in:
@@ -2,14 +2,13 @@ package fields
|
||||
|
||||
import (
|
||||
E "github.com/yusing/go-proxy/error"
|
||||
F "github.com/yusing/go-proxy/utils/functional"
|
||||
)
|
||||
|
||||
type Path struct{ F.Stringable }
|
||||
type Path string
|
||||
|
||||
func NewPath(s string) (Path, E.NestedError) {
|
||||
if s == "" || s[0] == '/' {
|
||||
return Path{F.NewStringable(s)}, E.Nil()
|
||||
return Path(s), E.Nil()
|
||||
}
|
||||
return Path{}, E.Invalid("path", s).With("must be empty or start with '/'")
|
||||
return "", E.Invalid("path", s).With("must be empty or start with '/'")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user