Преглед на файлове

Merge pull request #33725 from ripcurld0/deprecate_go16

Remove Go 1.6 code from moby
Akihiro Suda преди 8 години
родител
ревизия
93c06b8013
променени са 3 файла, в които са добавени 0 реда и са изтрити 49 реда
  1. 0 2
      api/server/httputils/httputils_write_json.go
  2. 0 16
      api/server/httputils/httputils_write_json_go16.go
  3. 0 31
      pkg/tlsconfig/tlsconfig_clone_go16.go

+ 0 - 2
api/server/httputils/httputils_write_json.go

@@ -1,5 +1,3 @@
-// +build go1.7
-
 package httputils
 
 import (

+ 0 - 16
api/server/httputils/httputils_write_json_go16.go

@@ -1,16 +0,0 @@
-// +build go1.6,!go1.7
-
-package httputils
-
-import (
-	"encoding/json"
-	"net/http"
-)
-
-// WriteJSON writes the value v to the http response stream as json with standard json encoding.
-func WriteJSON(w http.ResponseWriter, code int, v interface{}) error {
-	w.Header().Set("Content-Type", "application/json")
-	w.WriteHeader(code)
-	enc := json.NewEncoder(w)
-	return enc.Encode(v)
-}

+ 0 - 31
pkg/tlsconfig/tlsconfig_clone_go16.go

@@ -1,31 +0,0 @@
-// +build go1.6,!go1.7
-
-package tlsconfig
-
-import "crypto/tls"
-
-// Clone returns a clone of tls.Config. This function is provided for
-// compatibility for go1.6 that doesn't include this method in stdlib.
-func Clone(c *tls.Config) *tls.Config {
-	return &tls.Config{
-		Rand:                     c.Rand,
-		Time:                     c.Time,
-		Certificates:             c.Certificates,
-		NameToCertificate:        c.NameToCertificate,
-		GetCertificate:           c.GetCertificate,
-		RootCAs:                  c.RootCAs,
-		NextProtos:               c.NextProtos,
-		ServerName:               c.ServerName,
-		ClientAuth:               c.ClientAuth,
-		ClientCAs:                c.ClientCAs,
-		InsecureSkipVerify:       c.InsecureSkipVerify,
-		CipherSuites:             c.CipherSuites,
-		PreferServerCipherSuites: c.PreferServerCipherSuites,
-		SessionTicketsDisabled:   c.SessionTicketsDisabled,
-		SessionTicketKey:         c.SessionTicketKey,
-		ClientSessionCache:       c.ClientSessionCache,
-		MinVersion:               c.MinVersion,
-		MaxVersion:               c.MaxVersion,
-		CurvePreferences:         c.CurvePreferences,
-	}
-}