You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: wecom.go
    path of file: ./repos/mindoc/utils/auth2/wecom
    
    the code of the file until where you have to start completion: package wecom

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"github.com/mindoc-o
    
func (c *WorkWechatClient) GetUserInfo(ctx context.Context, code string) (auth2.UserInfo, error) {
	var info auth2.UserInfo

	userid, err := c.getUserId(ctx, code)
	if err != nil {
		return info, err
	}

	userInfo, err := c.getUserInfo(ctx, userid.UserId)
	if err != nil {
		return info, err
	}

	info.UserId = userInfo.UserId
	info.Name = userInfo.Name

	if userid.UserTicket == "" {
		return info, nil
	}

	private, err := c.getUserPrivateInfo(ctx, userid.UserTicket)
	if err != nil {
		return info, err
	}

	info.Mail = private.BizMail
	info.Avatar = private.Avatar
	info.Mobile = private.Mobile
	return info, nil
}