Browse Source

field checker test

0x4a52466c696e74 4 months ago
parent
commit
36b2595b0c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      fielder.go

+ 3 - 0
fielder.go

@@ -291,6 +291,9 @@ func FieldNames(s any) (FieldNamesList, error) {
 /////////////////////////////////////////////
 
 func OutFields(req IRequestIn, obj any, files RequestFiles, names ...any) IRequestOut {
+	if files == nil {
+		files = make(RequestFiles)
+	}
 	m, err := Fields(obj, files, names...)
 	if err != nil {
 		return req.OutError(err)