This is an automated email from the ASF dual-hosted git repository. AlexStocks pushed a commit to branch codex/cleanup-pr-3471-p2 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
commit 510593b614aa2c42e13b3fcb0a72f2dd44e89480 Author: Xin.Zh <[email protected]> AuthorDate: Mon Jul 13 13:50:35 2026 +0800 style: clean up minor review issues Avoid scanning the same suffix twice when extracting sub-properties, and remove an unnecessary blank statement from the SequenceID concurrency test. Tested: gofmt -w common/config/environment.go remoting/exchange_test.go; go test ./common/config ./remoting -count=1; go vet ./common/config ./remoting; git diff --check; wsl bash -lc 'cd /mnt/d/test/github/dubbo-go && go test ./common/config ./remoting -count=1' Co-authored-by: OmX <[email protected]> Signed-off-by: Xin.Zh <[email protected]> --- common/config/environment.go | 4 ++-- remoting/exchange_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/config/environment.go b/common/config/environment.go index a03cea54a..b6655e5a8 100644 --- a/common/config/environment.go +++ b/common/config/environment.go @@ -138,8 +138,8 @@ func (conf *InmemoryConfiguration) GetSubProperty(subKey string) map[string]stru conf.store.Range(func(key, _ any) bool { if idx := strings.Index(key.(string), subKey); idx >= 0 { after := key.(string)[idx+len(subKey):] - if found := strings.Contains(after, "."); found { - properties[after[0:strings.Index(after, ".")]] = struct{}{} + if idx := strings.Index(after, "."); idx >= 0 { + properties[after[0:idx]] = struct{}{} } } diff --git a/remoting/exchange_test.go b/remoting/exchange_test.go index 73e073a1b..493f9f567 100644 --- a/remoting/exchange_test.go +++ b/remoting/exchange_test.go @@ -43,7 +43,7 @@ func TestSequenceIDConcurrent(t *testing.T) { var wg sync.WaitGroup ids := make(chan int64, 50) for range 50 { - wg.Go(func() { ; ids <- SequenceID() }) + wg.Go(func() { ids <- SequenceID() }) } wg.Wait() close(ids)
