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: api.go
    path of file: ./repos/client/go/invitefriends
    
    the code of the file until where you have to start completion: package invitefriends

import (
	"sync"

	"github.com/keybase/client/go/libkb"
	"github.com/keybase/client/go/protocol/keybase1"
)

var (
	countsCache   *keybase1.InviteCounts
	countsCacheMu sync.Mutex // mutex isn't rw due to low call frequency
)

func GetCounts(mctx libkb.MetaContext) (counts keybase1.InviteCounts, err error) {
	type apiRes struct {
    
func GetCounts(mctx libkb.MetaContext) (counts keybase1.InviteCounts, err error) {
	type apiRes struct {
		NumInvites       int     `json:"numInvites"`
		PercentageChange float64 `json:"percentageChange"`
		ShowNumInvites   bool    `json:"showNumInvites"`
		ShowFire         bool    `json:"showFire"`
		TooltipMarkdown  string  `json:"tooltipMarkdown"`
		libkb.AppStatusEmbed
	}
	apiArg := libkb.APIArg{
		Endpoint:    "invite_friends/num_invites",
		SessionType: libkb.APISessionTypeNONE,
	}
	var res apiRes
	err = mctx.G().API.GetDecode(mctx, apiArg, &res)
	if err != nil {
		return counts, err
	}
	newCounts := keybase1.InviteCounts{
		InviteCount:      res.NumInvites,
		PercentageChange: res.PercentageChange,
		ShowNumInvites:   res.ShowNumInvites,
		ShowFire:         res.ShowFire,
		TooltipMarkdown:  res.TooltipMarkdown,
	}
	countsCacheMu.Lock()
	countsCache = &newCounts
	countsCacheMu.Unlock()
	return newCounts, nil
}