adapter.go
func Install(typ reflect.Type, adapter Adapter) {
	if adapter.Encode == nil {
		panic("objconv: the encoder function of an adapter cannot be nil")
	}

	if adapter.Decode == nil {
		panic("objconv: the decoder function of an adapter cannot be nil")
	}

	adapterMutex.Lock()
	adapterStore[typ] = adapter
	adapterMutex.Unlock()

	// We have to clear the struct cache because it may now have become invalid.
	// Because installing adapters is done in the package initialization phase
	// it's unlikely that any encoding or decoding operations are taking place
	// at this time so there should be no performance impact of clearing the
	// cache.
	structCache.clear()
}
func Install(typ reflect.Type, adapter Adapter) {
	if adapter.Encode == nil {
		panic("objconv: the encoder function of an adapter cannot be nil")
	}

	if adapter.Decode == nil {
		panic("objconv: the decoder function of an adapter cannot be nil")
	}

	adapterMutex.Lock()
	adapterStore[typ] = adapter
	adapterMutex.Unlock()

	// We have to clear the struct cache because it may now have become invalid.
	// Because installing adapters is done in the package initialization phase
	// it's unlikely that any encoding or decoding operations are taking place
	// at this time so there should be no performance impact of clearing the
	// cache.
	structCache.clear()
}
// Install adds an adapter for typ.
//
// The function panics if one of the encoder and decoder functions of the
// adapter are nil.
//
// A typical use case for this function is to be called during the package
// initialization phase to extend objconv support for new types.