How to get UID in Golang of Answer source code?

Viewed 174

How to get UID (User ID) in Golang of Answer source code?

Can you be more specific about UID? What's the id?

User ID

1 Answers
import "github.com/apache/incubator-answer/internal/base/middleware"

userID := middleware.GetLoginUserIDFromContext(ctx)

Do you need to import anything? Can it be used directly?

import "github.com/apache/incubator-answer/internal/base/middleware"