This is an automated email from the ASF dual-hosted git repository.
zixuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new 718a631 Remove go1.11 code leftovers (#946)
718a631 is described below
commit 718a631aeafcbcd23912562698c4098b0ecd4411
Author: Eugene R <[email protected]>
AuthorDate: Mon Feb 6 10:25:02 2023 +0200
Remove go1.11 code leftovers (#946)
---
pulsar/internal/http_client.go | 2 +-
pulsar/internal/http_client_go_1.11.go | 33 ---------------------------------
pulsar/internal/http_client_go_1.12.go | 27 ---------------------------
3 files changed, 1 insertion(+), 61 deletions(-)
diff --git a/pulsar/internal/http_client.go b/pulsar/internal/http_client.go
index 672a65e..a7308cb 100644
--- a/pulsar/internal/http_client.go
+++ b/pulsar/internal/http_client.go
@@ -47,7 +47,7 @@ type httpClient struct {
func (c *httpClient) Close() {
if c.HTTPClient != nil {
- CloseIdleConnections(c.HTTPClient)
+ c.HTTPClient.CloseIdleConnections()
}
}
diff --git a/pulsar/internal/http_client_go_1.11.go
b/pulsar/internal/http_client_go_1.11.go
deleted file mode 100644
index 095a30f..0000000
--- a/pulsar/internal/http_client_go_1.11.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-//go:build !go1.12
-// +build !go1.12
-
-package internal
-
-import "net/http"
-
-func CloseIdleConnections(c *http.Client) {
- type closeIdler interface {
- CloseIdleConnections()
- }
-
- if tr, ok := c.Transport.(closeIdler); ok {
- tr.CloseIdleConnections()
- }
-}
diff --git a/pulsar/internal/http_client_go_1.12.go
b/pulsar/internal/http_client_go_1.12.go
deleted file mode 100644
index 2d11d48..0000000
--- a/pulsar/internal/http_client_go_1.12.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-//go:build go1.12
-// +build go1.12
-
-package internal
-
-import "net/http"
-
-func CloseIdleConnections(c *http.Client) {
- c.CloseIdleConnections()
-}