mirror of
https://github.com/laravel-ls/uri
synced 2026-07-04 08:23:43 +02:00
uri: fix lint suggestion
This commit is contained in:
parent
0e3caec80a
commit
b45bca663f
1 changed files with 4 additions and 6 deletions
10
uri.go
10
uri.go
|
|
@ -246,7 +246,7 @@ func (u *URI) UnmarshalJSON(b []byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// String implements fmt.Stringer.
|
// String implements fmt.Stringer.
|
||||||
func (u URI) String() string {
|
func (u *URI) String() string {
|
||||||
switch u.Scheme {
|
switch u.Scheme {
|
||||||
case FileScheme, HTTPScheme, HTTPSScheme:
|
case FileScheme, HTTPScheme, HTTPSScheme:
|
||||||
if u.skipEncoding {
|
if u.skipEncoding {
|
||||||
|
|
@ -393,10 +393,8 @@ func encodeMinimal(path string, _ bool) string {
|
||||||
b.WriteString(path[0:i])
|
b.WriteString(path[0:i])
|
||||||
}
|
}
|
||||||
b.WriteString(encodeTable[code])
|
b.WriteString(encodeTable[code])
|
||||||
} else {
|
} else if b.String() != "" {
|
||||||
if b.String() != "" {
|
b.WriteByte(path[i])
|
||||||
b.WriteByte(path[i])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -408,7 +406,7 @@ func encodeMinimal(path string, _ bool) string {
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
func format(uri URI, skipEncoding bool) string {
|
func format(uri *URI, skipEncoding bool) string {
|
||||||
var encoder func(string, bool) string
|
var encoder func(string, bool) string
|
||||||
switch skipEncoding {
|
switch skipEncoding {
|
||||||
case true:
|
case true:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue