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: registry.go
    path of file: ./repos/kubeless/pkg/registry
    
    the code of the file until where you have to start completion: /*
Copyright (c) 2016-2017 Bitnami

Licensed under the Apache License, Version 2.0 (the 
    
func (r *Registry) tagURL(img string) (string, error) {
	switch r.Version {
	case "v1":
		return fmt.Sprintf("%s/%s/repositories/%s/tags", r.Endpoint, r.Version, img), nil
	case "v2":
		return fmt.Sprintf("%s/%s/%s/tags/list", r.Endpoint, r.Version, img), nil
	default:
		return "", fmt.Errorf("API version %s not supported", r.Version)
	}
}