summaryrefslogtreecommitdiff
path: root/caddyconfig/httpcaddyfile/httptype.go
diff options
context:
space:
mode:
authorMohammed Al Sahaf <msaa1990@gmail.com>2020-04-09 00:31:51 +0300
committerGitHub <noreply@github.com>2020-04-08 15:31:51 -0600
commit7dfd69cdc5966ae454e35cd6e976686131bfda8d (patch)
tree4d58832966c5136d5be3d9b3f63dcb07c30999d1 /caddyconfig/httpcaddyfile/httptype.go
parent28fdf64dc510472ccd9e6d46eb149d19cd70919a (diff)
chore: make the linter happier (#3245)
* chore: make the linter happier * chore: remove reference to maligned linter in .golangci.yml
Diffstat (limited to 'caddyconfig/httpcaddyfile/httptype.go')
-rw-r--r--caddyconfig/httpcaddyfile/httptype.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go
index 4c5f445..b7d16d8 100644
--- a/caddyconfig/httpcaddyfile/httptype.go
+++ b/caddyconfig/httpcaddyfile/httptype.go
@@ -50,7 +50,7 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock,
// chosen to handle a request - we actually will make each
// server block's route terminal so that only one will run
sbKeys := make(map[string]struct{})
- var serverBlocks []serverBlock
+ serverBlocks := make([]serverBlock, 0, len(originalServerBlocks))
for i, sblock := range originalServerBlocks {
for j, k := range sblock.Keys {
if _, ok := sbKeys[k]; ok {
@@ -939,7 +939,7 @@ func (st *ServerType) compileEncodedMatcherSets(sblock serverBlock) ([]caddy.Mod
}
// finally, encode each of the matcher sets
- var matcherSetsEnc []caddy.ModuleMap
+ matcherSetsEnc := make([]caddy.ModuleMap, 0, len(matcherSets))
for _, ms := range matcherSets {
msEncoded, err := encodeMatcherSet(ms)
if err != nil {