should we init assign *error as false, otherwise if the caller assign error as true before calling, then error will be false after return. That is a wrong assumption.

And, I do not see you use the error value when call this func `getResourceType`, please determine whether this api need to be changed. For example is there a invalid `ResourceType` type to show any wrong condition.