Skip to content

Commit 086c002

Browse files
authored
Merge pull request #38 from kromiii/fix-issue-36
correct flag type name
2 parents 259221e + ad1efd9 commit 086c002

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/unleash/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func getExpectedLifetime(flagType string) time.Duration {
8686
return 40 * 24 * time.Hour // 40日
8787
case "operational":
8888
return 7 * 24 * time.Hour // 7日
89-
case "killSwitch", "permission":
89+
case "kill-switch", "permission":
9090
return time.Duration(math.MaxInt64) // 実質的に永続
9191
default:
9292
return 30 * 24 * time.Hour // デフォルトは30日

internal/unleash/client_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestGetStaleFlags(t *testing.T) {
2222
{Name: "flag1", Type: "release", CreatedAt: time.Now().Add(-41 * 24 * time.Hour), Enabled: true, Stale: false},
2323
{Name: "flag2", Type: "experiment", CreatedAt: time.Now().Add(-30 * 24 * time.Hour), Enabled: true, Stale: false},
2424
{Name: "flag3", Type: "operational", CreatedAt: time.Now().Add(-8 * 24 * time.Hour), Enabled: true, Stale: true},
25-
{Name: "flag4", Type: "killSwitch", CreatedAt: time.Now().Add(-366 * 24 * time.Hour), Enabled: true, Stale: false},
25+
{Name: "flag4", Type: "kill-switch", CreatedAt: time.Now().Add(-366 * 24 * time.Hour), Enabled: true, Stale: false},
2626
},
2727
}
2828
if err := json.NewEncoder(w).Encode(response); err != nil {
@@ -74,7 +74,7 @@ func TestGetExpectedLifetime(t *testing.T) {
7474
{"release", "release", 40 * 24 * time.Hour},
7575
{"experiment", "experiment", 40 * 24 * time.Hour},
7676
{"operational", "operational", 7 * 24 * time.Hour},
77-
{"killSwitch", "killSwitch", time.Duration(math.MaxInt64)},
77+
{"killSwitch", "kill-switch", time.Duration(math.MaxInt64)},
7878
{"permission", "permission", time.Duration(math.MaxInt64)},
7979
{"default", "unknown", 30 * 24 * time.Hour},
8080
}

0 commit comments

Comments
 (0)