mirror of
https://github.com/laravel-ls/uri
synced 2026-06-16 01:54:57 +02:00
uri: change URI.Filename to just returns the filename
This commit is contained in:
parent
7580533e42
commit
43c82a6371
1 changed files with 5 additions and 5 deletions
10
uri.go
10
uri.go
|
|
@ -45,15 +45,15 @@ const (
|
|||
// urn:example:animal:ferret:nose
|
||||
type URI string
|
||||
|
||||
// Filename returns the file path for the given URI. It will return an error if
|
||||
// the URI is invalid, or if the URI does not have the file scheme.
|
||||
func (u URI) Filename() (string, error) {
|
||||
// Filename returns the file path for the given URI.
|
||||
// It is an error to call this on a URI that is not a valid filename.
|
||||
func (u URI) Filename() string {
|
||||
filename, err := filename(u)
|
||||
if err != nil {
|
||||
return "", err
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return filepath.FromSlash(filename), nil
|
||||
return filepath.FromSlash(filename)
|
||||
}
|
||||
|
||||
func filename(uri URI) (string, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue