mirror of
https://github.com/laravel-ls/uri
synced 2026-06-16 01:54:57 +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.
|
||||
func (u URI) String() string {
|
||||
func (u *URI) String() string {
|
||||
switch u.Scheme {
|
||||
case FileScheme, HTTPScheme, HTTPSScheme:
|
||||
if u.skipEncoding {
|
||||
|
|
@ -393,10 +393,8 @@ func encodeMinimal(path string, _ bool) string {
|
|||
b.WriteString(path[0:i])
|
||||
}
|
||||
b.WriteString(encodeTable[code])
|
||||
} else {
|
||||
if b.String() != "" {
|
||||
b.WriteByte(path[i])
|
||||
}
|
||||
} else if b.String() != "" {
|
||||
b.WriteByte(path[i])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -408,7 +406,7 @@ func encodeMinimal(path string, _ bool) string {
|
|||
return res
|
||||
}
|
||||
|
||||
func format(uri URI, skipEncoding bool) string {
|
||||
func format(uri *URI, skipEncoding bool) string {
|
||||
var encoder func(string, bool) string
|
||||
switch skipEncoding {
|
||||
case true:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue