Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: annotate multi-words fields#116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 1 commit intocoder:mainfrommtojek:fix-annotate-multi
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletionsprovider/decode_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
package provider_test

import (
"testing"

"github.com/coder/terraform-provider-coder/provider"
"github.com/mitchellh/mapstructure"
"github.com/stretchr/testify/require"
)

func TestDecode(t *testing.T) {
const (
legacyVariable = "Legacy Variable"
legacyVariableName = "Legacy Variable Name"
)

aMap := map[string]interface{}{
"name": "Parameter Name",
"legacy_variable": legacyVariable,
"legacy_variable_name": legacyVariableName,
}

var param provider.Parameter
err := mapstructure.Decode(aMap, &param)
require.NoError(t, err)
require.Equal(t, legacyVariable, param.LegacyVariable)
require.Equal(t, legacyVariableName, param.LegacyVariableName)
}
4 changes: 2 additions & 2 deletionsprovider/parameter.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,8 +51,8 @@ type Parameter struct {
Validation []Validation
Optional bool

LegacyVariableName string
LegacyVariable string
LegacyVariableName string `mapstructure:"legacy_variable_name"`
LegacyVariable string `mapstructure:"legacy_variable"`
}

func parameterDataSource() *schema.Resource {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp