Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
Signed-off-by: Maia Iyer <[email protected]>
  • Loading branch information
maia-iyer committed Oct 17, 2024
1 parent 395e0e8 commit a7d121b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions api/agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ func stringFromToken(keyToken token.Token) (string, error) {
// getPluginConfig returns first plugin configuration
func getPluginConfig(plugin *ast.ObjectItem) (string, ast.Node, error) {
// extract plugin name and value
pluginName, err := stringFromToken(plugin.Keys[1].Token)
if err != nil {
return "", nil, fmt.Errorf("invalid plugin type name %q: %w", plugin.Keys[1].Token.Text, err)
pluginKeys := plugin.Keys

Check failure on line 38 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

pluginKeys declared and not used

Check failure on line 38 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

pluginKeys declared and not used

Check failure on line 38 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

pluginKeys declared and not used

Check failure on line 38 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

pluginKeys declared and not used
var pluginName string

if len(plugin.Keys > 1) {

Check failure on line 41 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

cannot convert 1 (untyped int constant) to type []*ast.ObjectKey

Check failure on line 41 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

cannot convert 1 (untyped int constant) to type []*ast.ObjectKey

Check failure on line 41 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

cannot convert 1 (untyped int constant) to type []*ast.ObjectKey

Check failure on line 41 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

cannot convert 1 (untyped int constant) to type []*ast.ObjectKey
pluginName, err := stringFromToken(plugin.Keys[1].Token)

Check failure on line 42 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

pluginName declared and not used (typecheck)

Check failure on line 42 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

pluginName declared and not used) (typecheck)

Check failure on line 42 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

pluginName declared and not used (typecheck)

Check failure on line 42 in api/agent/config.go

View workflow job for this annotation

GitHub Actions / tornjak-build

pluginName declared and not used) (typecheck)
if err != nil {
return "", nil, fmt.Errorf("invalid plugin type name %q: %w", plugin.Keys[1].Token.Text, err)
}
} else {
pluginName = ""
}
// extract data
var hclPluginConfig hclPluginConfig
Expand Down

0 comments on commit a7d121b

Please sign in to comment.