mirror of https://github.com/tikv/client-go.git
use ioutil.ReadFile to release dependency of Go 1.16 (#217)
Signed-off-by: Sandy Xu <sandy@juicedata.io>
This commit is contained in:
parent
a1adc5b85b
commit
aadf3cf627
|
@ -15,7 +15,7 @@ jobs:
|
|||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
go-version: 1.15
|
||||
|
||||
- name: Test
|
||||
run: go test ./...
|
||||
|
@ -28,7 +28,7 @@ jobs:
|
|||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
go-version: 1.15
|
||||
|
||||
- name: Test with race
|
||||
run: go test -race ./...
|
||||
|
@ -42,7 +42,7 @@ jobs:
|
|||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
go-version: 1.15
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v2
|
||||
|
|
|
@ -35,7 +35,7 @@ package config
|
|||
import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"os"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/pingcap/errors"
|
||||
)
|
||||
|
@ -64,7 +64,7 @@ func (s *Security) ToTLSConfig() (tlsConfig *tls.Config, err error) {
|
|||
certPool := x509.NewCertPool()
|
||||
// Create a certificate pool from the certificate authority
|
||||
var ca []byte
|
||||
ca, err = os.ReadFile(s.ClusterSSLCA)
|
||||
ca, err = ioutil.ReadFile(s.ClusterSSLCA)
|
||||
if err != nil {
|
||||
err = errors.Errorf("could not read ca certificate: %s", err)
|
||||
return
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
@ -47,8 +48,8 @@ func TestTLSConfig(t *testing.T) {
|
|||
keyFile := filepath.Join(filepath.Dir(localFile), "key.pem")
|
||||
perm := os.FileMode(0666)
|
||||
|
||||
assert.Nil(t, os.WriteFile(certFile, []byte(cert), perm))
|
||||
assert.Nil(t, os.WriteFile(keyFile, []byte(key), perm))
|
||||
assert.Nil(t, ioutil.WriteFile(certFile, []byte(cert), perm))
|
||||
assert.Nil(t, ioutil.WriteFile(keyFile, []byte(key), perm))
|
||||
|
||||
security := Security{
|
||||
ClusterSSLCA: certFile,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module gcworker
|
||||
|
||||
go 1.16
|
||||
go 1.15
|
||||
|
||||
require github.com/tikv/client-go/v2 v2.0.0
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module rawkv
|
||||
|
||||
go 1.16
|
||||
go 1.15
|
||||
|
||||
require github.com/tikv/client-go/v2 v2.0.0
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module txnkv
|
||||
|
||||
go 1.16
|
||||
go 1.15
|
||||
|
||||
require github.com/tikv/client-go/v2 v2.0.0
|
||||
|
||||
|
|
Loading…
Reference in New Issue