From b45bca663f968d822cec062332715a20d4d8f95c Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Wed, 5 Jun 2019 12:28:28 +0900 Subject: [PATCH] uri: fix lint suggestion --- uri.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/uri.go b/uri.go index c04ca4f..e7c7150 100644 --- a/uri.go +++ b/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: