Skip to content

Commit 21d3011

Browse files
fix: cacheStore syntax fix (#89)
1 parent 88282c2 commit 21d3011

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

templates/internal/cachestore/cachestore.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ package cachestore
33
import (
44
"os"
55
"fmt"
6-
<%if eq (index .Params `cachestore`) "redis" %>
6+
<%if eq (index .Params `cacheStore`) "redis" %>
77
"context"
88
"github.com/go-redis/redis/v8"
99
<% end %>
10-
<%if eq (index .Params `cachestore`) "memcached" %>
10+
<%if eq (index .Params `cacheStore`) "memcached" %>
1111
"github.com/bradfitz/gomemcache/memcache"
1212
<% end %>
1313
)
1414

1515
var cacheEndpoint = os.Getenv("CACHE_ENDPOINT")
1616
var cachePort = os.Getenv("CACHE_PORT")
1717

18-
<%if eq (index .Params `cachestore`) "redis" %>
18+
<%if eq (index .Params `cacheStore`) "redis" %>
1919
func TestConnection() {
2020
context := context.Background()
2121
rdb := redis.NewClient(&redis.Options{
@@ -31,7 +31,7 @@ func TestConnection() {
3131
}
3232
<% end %>
3333

34-
<%if eq (index .Params `cachestore`) "memcached" %>
34+
<%if eq (index .Params `cacheStore`) "memcached" %>
3535
func TestConnection() {
3636
mc := memcache.New(fmt.Sprintf("%s:%s", cacheEndpoint, cachePort))
3737
err := mc.Set(&memcache.Item{Key: "cache-test", Value: []byte("value")})

templates/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
<%if eq (index .Params `billingEnabled`) "yes" %>
2525
"<% .Files.Repository %>/internal/billing"
2626
<%- end %>
27-
<%if neq (index .Params `cachestore`) "none" %>
27+
<%if neq (index .Params `cacheStore`) "none" %>
2828
"<% .Files.Repository %>/internal/cachestore"
2929
<% end %>
3030
)
@@ -38,7 +38,7 @@ func main() {
3838
db := database.Connect()
3939
db.TestConnection()
4040

41-
<%if neq (index .Params `cachestore`) "none" %>
41+
<%if neq (index .Params `cacheStore`) "none" %>
4242
// test cacheStore connection
4343
cachestore.TestConnection()
4444
<% end %>

0 commit comments

Comments
 (0)