Skip to content

Commit e40e764

Browse files
committed
[chore] prevent unkeyed literal initialization
1 parent f9b5841 commit e40e764

File tree

6 files changed

+21
-0
lines changed

6 files changed

+21
-0
lines changed

extension/ackextension/config.go

+2
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ type Config struct {
1515
MaxNumPartition uint64 `mapstructure:"max_number_of_partition"`
1616
// MaxNumPendingAcksPerPartition Specifies the maximum number of ackIDs and their corresponding status information that are waiting to be queried in each partition.
1717
MaxNumPendingAcksPerPartition uint64 `mapstructure:"max_number_of_pending_acks_per_partition"`
18+
// prevent unkeyed literal initializatin
19+
_ struct{}
1820
}

extension/asapauthextension/config.go

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ type Config struct {
2929
Audience []string `mapstructure:"audience"`
3030

3131
PrivateKey configopaque.String `mapstructure:"private_key"`
32+
// prevent unkeyed literal initializatin
33+
_ struct{}
3234
}
3335

3436
func (c *Config) Validate() error {

extension/awsproxy/config.go

+2
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ import (
1111
type Config struct {
1212
// ProxyServer defines configurations related to the local TCP proxy server.
1313
ProxyConfig proxy.Config `mapstructure:",squash"`
14+
// prevent unkeyed literal initializatin
15+
_ struct{}
1416
}

extension/basicauthextension/config.go

+6
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,26 @@ type HtpasswdSettings struct {
1919
File string `mapstructure:"file"`
2020
// Inline contents of the htpasswd file.
2121
Inline string `mapstructure:"inline"`
22+
// prevent unkeyed literal initializatin
23+
_ struct{}
2224
}
2325

2426
type ClientAuthSettings struct {
2527
// Username holds the username to use for client authentication.
2628
Username string `mapstructure:"username"`
2729
// Password holds the password to use for client authentication.
2830
Password configopaque.String `mapstructure:"password"`
31+
// prevent unkeyed literal initializatin
32+
_ struct{}
2933
}
3034
type Config struct {
3135
// Htpasswd settings.
3236
Htpasswd *HtpasswdSettings `mapstructure:"htpasswd,omitempty"`
3337

3438
// ClientAuth settings
3539
ClientAuth *ClientAuthSettings `mapstructure:"client_auth,omitempty"`
40+
// prevent unkeyed literal initializatin
41+
_ struct{}
3642
}
3743

3844
func (cfg *Config) Validate() error {

extension/bearertokenauthextension/config.go

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ type Config struct {
2323

2424
// Filename points to a file that contains the bearer token(s) to use for every RPC.
2525
Filename string `mapstructure:"filename,omitempty"`
26+
27+
// prevent unkeyed literal initializatin
28+
_ struct{}
2629
}
2730

2831
var (

extension/cgroupruntimeextension/config.go

+6
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ import "errors" // Config contains the configuration for the cgroup runtime exte
88
type Config struct {
99
GoMaxProcs GoMaxProcsConfig `mapstructure:"gomaxprocs"`
1010
GoMemLimit GoMemLimitConfig `mapstructure:"gomemlimit"`
11+
// prevent unkeyed literal initializatin
12+
_ struct{}
1113
}
1214

1315
type GoMaxProcsConfig struct {
1416
Enabled bool `mapstructure:"enabled"`
17+
// prevent unkeyed literal initializatin
18+
_ struct{}
1519
}
1620

1721
type GoMemLimitConfig struct {
1822
Enabled bool `mapstructure:"enabled"`
1923
Ratio float64 `mapstructure:"ratio"`
24+
// prevent unkeyed literal initializatin
25+
_ struct{}
2026
}
2127

2228
// Validate checks if the extension configuration is valid

0 commit comments

Comments
 (0)