I am not grocking what the compiler trys to tell me. If I make value receivers it works, but thats not how Merge should be implemented, it needs a pointer receiver.
It tells you that you cannot use Settings type as the interface, because this type does not implement this interface. The error is in main function here:
ParseCISettings[Settings]()
You implemented both methods Clone and Merge for pointer: *Settings!
func (s *Settings) Clone() CISettings {
return &Settings{}
}
func (s *Settings) Merge(other CISettings) {}
You either need to change it to value itself or change the generic type you are passing in main:
Thanks, thats close to what I want.
But what ever the parse function does I wanted to return a value Settings (or a pointer to it). But I dont know how to construct such a thing, cause var v T does not work. Or how do I construct a new value in a generic function using T as parameter?
Can you please be more specific on what exactly you are trying to achieve? What parameters the parsing function should have, what it will return, because now, I’m lost