Skip to content

Commit

Permalink
implement correct interface
Browse files Browse the repository at this point in the history
  • Loading branch information
christeredvartsen committed Feb 16, 2024
1 parent 6bae1e6 commit f35c1a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/gcp/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Cluster struct {
ProjectID string
}

func (c *Clusters) Decode(value string) error {
func (c *Clusters) EnvDecode(value string) error {
*c = make(Clusters)
if value == "" {
return nil
Expand Down
6 changes: 3 additions & 3 deletions internal/gcp/clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func TestDecodeJSONToClusters(t *testing.T) {
clusters := make(gcp.Clusters)

t.Run("empty string", func(t *testing.T) {
err := clusters.Decode("")
err := clusters.EnvDecode("")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand All @@ -21,7 +21,7 @@ func TestDecodeJSONToClusters(t *testing.T) {
})

t.Run("empty JSON object", func(t *testing.T) {
err := clusters.Decode("{}")
err := clusters.EnvDecode("{}")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand All @@ -32,7 +32,7 @@ func TestDecodeJSONToClusters(t *testing.T) {
})

t.Run("JSON with clusters", func(t *testing.T) {
err := clusters.Decode(`{
err := clusters.EnvDecode(`{
"env1": {"teams_folder_id": "123", "project_id": "some-id-123"},
"env2": {"teams_folder_id": "456", "project_id": "some-id-456"}
}`)
Expand Down

0 comments on commit f35c1a1

Please sign in to comment.