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: encoder.go
    path of file: ./repos/fabio/vendor/github.com/spf13/viper/internal/encoding
    
    the code of the file until where you have to start completion: package encoding

import (
	"sync"
)

// Encoder encodes the contents of v into a byte repr
    
func (e *EncoderRegistry) RegisterEncoder(format string, enc Encoder) error {
	e.mu.Lock()
	defer e.mu.Unlock()

	if _, ok := e.encoders[format]; ok {
		return ErrEncoderFormatAlreadyRegistered
	}

	e.encoders[format] = enc

	return nil
}