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: tool.go
    path of file: ./repos/studygolang/util
    
    the code of the file until where you have to start completion: // Copyright 2013 The StudyGolang Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// http://studygolang
    
func Gravatar(avatar string, emailI interface{}, size uint16, isHttps bool) string {
	gravatarDomain := "http://gravatar.com"
	if isHttps {
		gravatarDomain = "https://secure.gravatar.com"
	}
	cdnDomain := global.App.CanonicalCDN(isHttps)

	if avatar != "" {
		if strings.HasPrefix(avatar, "http") {
			return fmt.Sprintf("%s&s=%d", avatar, size)
		}
		return fmt.Sprintf("%savatar/%s?imageView2/2/w/%d", cdnDomain, avatar, size)
	}

	email, ok := emailI.(string)
	if !ok {
		return fmt.Sprintf("%savatar/gopher28.png?imageView2/2/w/%d", cdnDomain, size)
	}
	return fmt.Sprintf("%s/avatar/%s?s=%d", gravatarDomain, goutils.Md5(email), size)
}