Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get .tag: "file" or .tag: "folder" when get list folders API #74

Open
phuongTP1998 opened this issue Jan 26, 2021 · 2 comments
Open

Comments

@phuongTP1998
Copy link

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

image
but the result doesn't appear the ".tag" field

image
Hope someone can help!
Thanks

@phuongTP1998
Copy link
Author

From the document:
image

@andygrunwald
Copy link

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")
		}

	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants