var transformer … var encryptedPrefix … var errEncryptedData … type identityTransformer … // NewEncryptCheckTransformer returns an identityTransformer which returns an error // on attempts to read encrypted data func NewEncryptCheckTransformer() value.Transformer { … } // TransformFromStorage returns the input bytes if the data is not encrypted func (identityTransformer) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { … } // TransformToStorage implements the Transformer interface for identityTransformer func (identityTransformer) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { … }