Visitar URL original
Use reflect.Pointer instead of deprecated reflect.Ptr by williammartin · Pull Request #14098 · cli/cli · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions pkg/cmdutil/json_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (e *jsonExporter) Write(ios *iostreams.IOStreams, data interface{}) error {

func (e *jsonExporter) exportData(v reflect.Value) interface{} {
switch v.Kind() {
case reflect.Ptr, reflect.Interface:
case reflect.Pointer, reflect.Interface:
if !v.IsNil() {
return e.exportData(v.Elem())
}
Expand Down Expand Up @@ -306,7 +306,7 @@ var emptyInterfaceType = reflect.TypeOf(sliceOfEmptyInterface).Elem()
// need to be explicitly used.
func StructExportData(s interface{}, fields []string) map[string]interface{} {
v := reflect.ValueOf(s)
if v.Kind() == reflect.Ptr {
if v.Kind() == reflect.Pointer {
v = v.Elem()
}
if v.Kind() != reflect.Struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/search/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (q Qualifiers) Map() map[string][]string {
}
value := v.Field(i)
switch value.Kind() {
case reflect.Ptr:
case reflect.Pointer:
if value.IsNil() {
continue
}
Expand Down