From 485257035c8e80820e8b493a13a13fd065937839 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 11 Apr 2023 23:32:58 +0300 Subject: [PATCH] gofmt -s code Signed-off-by: Vasiliy Tolstov --- server/server.go | 9 ++++----- service.go | 1 + util/addr/addr.go | 1 + util/reflect/struct.go | 15 ++++++++------- util/text/text.go | 3 +-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/server/server.go b/server/server.go index cb79f946..9ad24907 100644 --- a/server/server.go +++ b/server/server.go @@ -145,12 +145,11 @@ type Stream interface { // // Example: // -// type Greeter struct {} -// -// func (g *Greeter) Hello(context, request, response) error { -// return nil -// } +// type Greeter struct {} // +// func (g *Greeter) Hello(context, request, response) error { +// return nil +// } type Handler interface { Name() string Handler() interface{} diff --git a/service.go b/service.go index 4de9fd4a..559ea5e0 100644 --- a/service.go +++ b/service.go @@ -88,6 +88,7 @@ func (s *service) Name() string { // Init initialises options. Additionally it calls cmd.Init // which parses command line flags. cmd.Init is only called // on first Init. +// //nolint:gocyclo func (s *service) Init(opts ...Option) error { var err error diff --git a/util/addr/addr.go b/util/addr/addr.go index 77308c8d..3c413c7c 100644 --- a/util/addr/addr.go +++ b/util/addr/addr.go @@ -58,6 +58,7 @@ func IsLocal(addr string) bool { } // Extract returns a real ip +// //nolint:gocyclo func Extract(addr string) (string, error) { // if addr specified then its returned diff --git a/util/reflect/struct.go b/util/reflect/struct.go index 8342d21b..44ce1fdf 100644 --- a/util/reflect/struct.go +++ b/util/reflect/struct.go @@ -493,13 +493,14 @@ func btSplitter(str string) []string { } // queryToMap turns something like a[b][c]=4 into -// map[string]interface{}{ -// "a": map[string]interface{}{ -// "b": map[string]interface{}{ -// "c": 4, -// }, -// }, -// } +// +// map[string]interface{}{ +// "a": map[string]interface{}{ +// "b": map[string]interface{}{ +// "c": 4, +// }, +// }, +// } func queryToMap(param string) (map[string]interface{}, error) { rawKey, rawValue, err := splitKeyAndValue(param) if err != nil { diff --git a/util/text/text.go b/util/text/text.go index f59485d0..36f65009 100644 --- a/util/text/text.go +++ b/util/text/text.go @@ -1,6 +1,5 @@ package text - func DetectEncoding(text string) map[string]int { charsets := map[string]int{ "UTF-8": 0, @@ -77,7 +76,7 @@ func DetectEncoding(text string) map[string]int { charsets["MAC"] += uppercase } - last_simb = char + last_simb = char } return charsets -- 2.45.2