dropbox-sdk-go-unofficial
dropbox-sdk-go-unofficial copied to clipboard
Can't get .tag: "file" or .tag: "folder" when get list folders API
I try to get the ".tag" field to identify between files and folders but I don't figure out how to get it from the the sdk This is how I pass the ListFolderArg
but the result doesn't appear the ".tag" field
Hope someone can help!
Thanks
From the document:
Here is a way how you can identify between files and folders:
path := "/my/path"
args := files.NewListFolderArg(path)
args.Recursive = true
res, err := dbx.ListFolder(args)
if err != nil {
panic(err)
}
for k, v := range res.Entries {
fmt.Printf("%+v // %+v\n", k, v)
switch v.(type) {
case *files.FileMetadata:
fmt.Println("File")
case *files.FolderMetadata:
fmt.Println("Folder")
}
}