mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 06:15:45 +00:00
Merge pull request #63417 from smarterclayton/map_string
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. FlagMaps may be nil (prior to being initialized) Do not panic if they haven't been set yet. Fixes: #64090
This commit is contained in:
commit
4c227ab821
@ -39,6 +39,9 @@ func NewMapStringBool(m *map[string]bool) *MapStringBool {
|
|||||||
|
|
||||||
// String implements github.com/spf13/pflag.Value
|
// String implements github.com/spf13/pflag.Value
|
||||||
func (m *MapStringBool) String() string {
|
func (m *MapStringBool) String() string {
|
||||||
|
if m == nil || m.Map == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
pairs := []string{}
|
pairs := []string{}
|
||||||
for k, v := range *m.Map {
|
for k, v := range *m.Map {
|
||||||
pairs = append(pairs, fmt.Sprintf("%s=%t", k, v))
|
pairs = append(pairs, fmt.Sprintf("%s=%t", k, v))
|
||||||
|
@ -50,6 +50,9 @@ func NewMapStringStringNoSplit(m *map[string]string) *MapStringString {
|
|||||||
|
|
||||||
// String implements github.com/spf13/pflag.Value
|
// String implements github.com/spf13/pflag.Value
|
||||||
func (m *MapStringString) String() string {
|
func (m *MapStringString) String() string {
|
||||||
|
if m == nil || m.Map == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
pairs := []string{}
|
pairs := []string{}
|
||||||
for k, v := range *m.Map {
|
for k, v := range *m.Map {
|
||||||
pairs = append(pairs, fmt.Sprintf("%s=%s", k, v))
|
pairs = append(pairs, fmt.Sprintf("%s=%s", k, v))
|
||||||
|
Loading…
Reference in New Issue
Block a user