How to add a class to anchor tags using the get_the_tag_list(); function? [duplicate]

I finally found the solution using a filter:

add_filter( "term_links-post_tag", 'add_tag_class');

function add_tag_class($links) {
return str_replace('<a href="', '<a class="myclass" href="', $links);
}