summaryrefslogtreecommitdiff
path: root/caddy.go
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2022-08-02 16:39:09 -0400
committerGitHub <noreply@github.com>2022-08-02 16:39:09 -0400
commit141872ed80d6323505e7543628c259fdae8506d3 (patch)
tree53581cddf2fcce189c3a55019194b64b0cd3af13 /caddy.go
parentdb1aa5b5bc174e5a5df39a277f737b304e1e2350 (diff)
chore: Bump up to Go 1.19, minimum 1.18 (#4925)
Diffstat (limited to 'caddy.go')
-rw-r--r--caddy.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/caddy.go b/caddy.go
index 20da5de..54c890b 100644
--- a/caddy.go
+++ b/caddy.go
@@ -217,7 +217,7 @@ func changeConfig(method, path string, input []byte, ifMatchHeader string, force
// with what caddy is still running; we need to
// unmarshal it again because it's likely that
// pointers deep in our rawCfg map were modified
- var oldCfg interface{}
+ var oldCfg any
err2 := json.Unmarshal(rawCfgJSON, &oldCfg)
if err2 != nil {
err = fmt.Errorf("%v; additionally, restoring old config: %v", err, err2)
@@ -251,9 +251,9 @@ func readConfig(path string, out io.Writer) error {
// "@id" and maps that ID value to the full configPath in the index.
// This function is NOT safe for concurrent access; obtain a write lock
// on currentCtxMu.
-func indexConfigObjects(ptr interface{}, configPath string, index map[string]string) error {
+func indexConfigObjects(ptr any, configPath string, index map[string]string) error {
switch val := ptr.(type) {
- case map[string]interface{}:
+ case map[string]any:
for k, v := range val {
if k == idKey {
switch idVal := v.(type) {
@@ -272,7 +272,7 @@ func indexConfigObjects(ptr interface{}, configPath string, index map[string]str
return err
}
}
- case []interface{}:
+ case []any:
// traverse each element of the array recursively
for i := range val {
err := indexConfigObjects(val[i], path.Join(configPath, strconv.Itoa(i)), index)
@@ -848,7 +848,7 @@ var (
// to maintain parity with the API endpoint and to avoid
// the special case of having to access/mutate the variable
// directly without traversing into it.
- rawCfg = map[string]interface{}{
+ rawCfg = map[string]any{
rawConfigKey: nil,
}