aboutsummaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
Diffstat (limited to 'setup')
-rw-r--r--setup/config/config.go10
-rw-r--r--setup/config/config_appservice.go4
-rw-r--r--setup/mscs/msc2836/msc2836_test.go6
3 files changed, 10 insertions, 10 deletions
diff --git a/setup/config/config.go b/setup/config/config.go
index 9b9000a6..924b51f2 100644
--- a/setup/config/config.go
+++ b/setup/config/config.go
@@ -19,8 +19,8 @@ import (
"encoding/pem"
"fmt"
"io"
- "io/ioutil"
"net/url"
+ "os"
"path/filepath"
"regexp"
"strings"
@@ -191,7 +191,7 @@ type ConfigErrors []string
// Load a yaml config file for a server run as multiple processes or as a monolith.
// Checks the config to ensure that it is valid.
func Load(configPath string, monolith bool) (*Dendrite, error) {
- configData, err := ioutil.ReadFile(configPath)
+ configData, err := os.ReadFile(configPath)
if err != nil {
return nil, err
}
@@ -199,9 +199,9 @@ func Load(configPath string, monolith bool) (*Dendrite, error) {
if err != nil {
return nil, err
}
- // Pass the current working directory and ioutil.ReadFile so that they can
+ // Pass the current working directory and os.ReadFile so that they can
// be mocked in the tests
- return loadConfig(basePath, configData, ioutil.ReadFile, monolith)
+ return loadConfig(basePath, configData, os.ReadFile, monolith)
}
func loadConfig(
@@ -530,7 +530,7 @@ func (config *Dendrite) KeyServerURL() string {
// SetupTracing configures the opentracing using the supplied configuration.
func (config *Dendrite) SetupTracing(serviceName string) (closer io.Closer, err error) {
if !config.Tracing.Enabled {
- return ioutil.NopCloser(bytes.NewReader([]byte{})), nil
+ return io.NopCloser(bytes.NewReader([]byte{})), nil
}
return config.Tracing.Jaeger.InitGlobalTracer(
serviceName,
diff --git a/setup/config/config_appservice.go b/setup/config/config_appservice.go
index 9b89fc9a..b8f99a61 100644
--- a/setup/config/config_appservice.go
+++ b/setup/config/config_appservice.go
@@ -16,7 +16,7 @@ package config
import (
"fmt"
- "io/ioutil"
+ "os"
"path/filepath"
"regexp"
"strings"
@@ -181,7 +181,7 @@ func loadAppServices(config *AppServiceAPI, derived *Derived) error {
}
// Read the application service's config file
- configData, err := ioutil.ReadFile(absPath)
+ configData, err := os.ReadFile(absPath)
if err != nil {
return err
}
diff --git a/setup/mscs/msc2836/msc2836_test.go b/setup/mscs/msc2836/msc2836_test.go
index edb1e77d..eeded427 100644
--- a/setup/mscs/msc2836/msc2836_test.go
+++ b/setup/mscs/msc2836/msc2836_test.go
@@ -7,7 +7,7 @@ import (
"crypto/sha256"
"encoding/base64"
"encoding/json"
- "io/ioutil"
+ "io"
"net/http"
"sort"
"strings"
@@ -428,12 +428,12 @@ func postRelationships(t *testing.T, expectCode int, accessToken string, req *ms
t.Fatalf("failed to do request: %s", err)
}
if res.StatusCode != expectCode {
- body, _ := ioutil.ReadAll(res.Body)
+ body, _ := io.ReadAll(res.Body)
t.Fatalf("wrong response code, got %d want %d - body: %s", res.StatusCode, expectCode, string(body))
}
if res.StatusCode == 200 {
var result msc2836.EventRelationshipResponse
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("response 200 OK but failed to read response body: %s", err)
}