1
0
Fork 0
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:
Koichi Shiraishi 2019-06-05 12:28:28 +09:00
parent 0e3caec80a
commit b45bca663f
No known key found for this signature in database
GPG key ID: A71DFD3B4DA7A79B

10
uri.go
View file

@ -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: