(config interface{})
| 49 | } |
| 50 | |
| 51 | func (f *Factory[T]) Create(config interface{}) (IAuth, error) { |
| 52 | cfg, err := generateStruct[T](config) |
| 53 | if err != nil { |
| 54 | return nil, err |
| 55 | } |
| 56 | authConfig, ok := interface{}(cfg).(IAuthConfig) |
| 57 | if !ok { |
| 58 | return nil, fmt.Errorf("no implement IAuthConfig") |
| 59 | } |
| 60 | return &Auth{driver: f.driver, authConfig: authConfig}, nil |
| 61 | } |
| 62 | |
| 63 | func generateStruct[T any](cfg interface{}) (*T, error) { |
| 64 | result := new(T) |
nothing calls this directly
no outgoing calls
no test coverage detected