Skip to content

Commit

Permalink
Path: Add MustParse function to parser interface
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Kosegi <richard.kosegi@gmail.com>
  • Loading branch information
rkosegi committed Jul 4, 2024
1 parent 1dbf454 commit e054561
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion path/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ type AppendOpt func(*component)

// Parser interface is implemented by different Path syntax parsers.
type Parser interface {
// Parse parses source string into Path
// Parse parses source string into Path.
// Any error encountered during parse is returned to caller.
Parse(string) (Path, error)
// MustParse parses source string into Path.
// Any error encountered during parse will cause panic.
MustParse(string) Path
}

// Serializer is interface that allows to serialize Path into lexical form
Expand Down

0 comments on commit e054561

Please sign in to comment.