Browse Source

client: deprecate client.CustomHTTPHeaders()

This function was added in a754d89b4058d8508cf3cee29f6107b2f93f3001, but not
used. Currently, the only consumer of this function I could find was docker/cli,
which used it in a unit-test (this test has already been updated to not depend
on this function); https://grep.app/search?q=.CustomHTTPHeaders%28%29&filter[lang][0]=Go

Given that commit a68ae4a2d95b1ff143025a435195af0f1ab30ace deprecated the
corresponding client.SetCustomHTTPHeaders() function, and because there is no
active use for this function, it should be ok to deprecate.

We can include this in a patch-release (to be sure nobody else is depending on
it, and (if someone is) to notify them of the deprecation.

As a follow-up to this commit, I'll remove both functions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 3 years ago
parent
commit
8afb57e633
1 changed files with 1 additions and 0 deletions
  1. 1 0
      client/client.go

+ 1 - 0
client/client.go

@@ -282,6 +282,7 @@ func ParseHostURL(host string) (*url.URL, error) {
 }
 }
 
 
 // CustomHTTPHeaders returns the custom http headers stored by the client.
 // CustomHTTPHeaders returns the custom http headers stored by the client.
+// Deprecated: this function was unused, and will be removed in the next release.
 func (cli *Client) CustomHTTPHeaders() map[string]string {
 func (cli *Client) CustomHTTPHeaders() map[string]string {
 	m := make(map[string]string)
 	m := make(map[string]string)
 	for k, v := range cli.customHTTPHeaders {
 	for k, v := range cli.customHTTPHeaders {