From 7174701b37a7c32b84b3551c4481dfb412c1cef3 Mon Sep 17 00:00:00 2001 From: xichengliudui <1693291525@qq.com> Date: Thu, 15 Aug 2019 02:03:22 -0400 Subject: [PATCH] Use constant blocks to define constants instead of discrete definitions. Signed-off-by: xichengliudui <1693291525@qq.com> --- client/httputils.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/client/httputils.go b/client/httputils.go index 7953bc5c8..1df2f655c 100644 --- a/client/httputils.go +++ b/client/httputils.go @@ -29,17 +29,20 @@ import ( "time" ) -// UnixScheme is a scheme for unix. -const UnixScheme = "unix" +const ( -// TCPScheme is a scheme for TCP. -const TCPScheme = "tcp" + // UnixScheme is a scheme for unix. + UnixScheme = "unix" -// HTTPScheme is a scheme for HTTP. -const HTTPScheme = "http" + // TCPScheme is a scheme for TCP. + TCPScheme = "tcp" -// HTTPSScheme is a scheme for HTTPS. -const HTTPSScheme = "https" + // HTTPScheme is a scheme for HTTP. + HTTPScheme = "http" + + // HTTPSScheme is a scheme for HTTPS. + HTTPSScheme = "https" +) // ParseHost inputs a host address string, and output four type: // url.URL, basePath, address without scheme and an error.