Skip to content

Commit d229959

Browse files
authoredJun 26, 2023
Remove unnecessary indent blocks (#1586)
1 parent 6b68042 commit d229959

File tree

2 files changed

+21
-28
lines changed

2 files changed

+21
-28
lines changed
 

‎client.go

+15-19
Original file line numberDiff line numberDiff line change
@@ -944,15 +944,13 @@ func clientGetURLDeadline(dst []byte, url string, deadline time.Time, c clientDo
944944

945945
statusCodeCopy, bodyCopy, errCopy := doRequestFollowRedirectsBuffer(req, dst, url, c)
946946
mu.Lock()
947-
{
948-
if !timedout {
949-
ch <- clientURLResponse{
950-
statusCode: statusCodeCopy,
951-
body: bodyCopy,
952-
err: errCopy,
953-
}
954-
responded = true
947+
if !timedout {
948+
ch <- clientURLResponse{
949+
statusCode: statusCodeCopy,
950+
body: bodyCopy,
951+
err: errCopy,
955952
}
953+
responded = true
956954
}
957955
mu.Unlock()
958956

@@ -967,17 +965,15 @@ func clientGetURLDeadline(dst []byte, url string, deadline time.Time, c clientDo
967965
err = resp.err
968966
case <-tc.C:
969967
mu.Lock()
970-
{
971-
if responded {
972-
resp := <-ch
973-
statusCode = resp.statusCode
974-
body = resp.body
975-
err = resp.err
976-
} else {
977-
timedout = true
978-
err = ErrTimeout
979-
body = dst
980-
}
968+
if responded {
969+
resp := <-ch
970+
statusCode = resp.statusCode
971+
body = resp.body
972+
err = resp.err
973+
} else {
974+
timedout = true
975+
err = ErrTimeout
976+
body = dst
981977
}
982978
mu.Unlock()
983979
}

‎server.go

+6-9
Original file line numberDiff line numberDiff line change
@@ -1788,15 +1788,12 @@ func (s *Server) Serve(ln net.Listener) error {
17881788
maxWorkersCount := s.getConcurrency()
17891789

17901790
s.mu.Lock()
1791-
{
1792-
s.ln = append(s.ln, ln)
1793-
if s.done == nil {
1794-
s.done = make(chan struct{})
1795-
}
1796-
1797-
if s.concurrencyCh == nil {
1798-
s.concurrencyCh = make(chan struct{}, maxWorkersCount)
1799-
}
1791+
s.ln = append(s.ln, ln)
1792+
if s.done == nil {
1793+
s.done = make(chan struct{})
1794+
}
1795+
if s.concurrencyCh == nil {
1796+
s.concurrencyCh = make(chan struct{}, maxWorkersCount)
18001797
}
18011798
s.mu.Unlock()
18021799

0 commit comments

Comments
 (0)
Please sign in to comment.