Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-12 Thread Alexander Shopov
r not moving, just > use it as a key to a map[*generated.Response]*EnrichedResponse to > lookup your additional state on either the caller or responder side. > > On Monday, May 12, 2025 at 1:12:25 PM UTC+1 Alexander Shopov wrote: > >> seems a very common assumption >> >&g

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-12 Thread Alexander Shopov
probably hold. Thanx for even further details (I am writing down the offset trick) but I'd prefer to not stray too far away from usual conventions. Kind regards: al_shopov На пн, 12.05.2025 г. в 12:14 Axel Wagner написа: > > > On Mon, 12 May 2025 at 11:12, Alexander Shopov wrot

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-12 Thread Alexander Shopov
Hello all and thanx for the answers. Here I provide more information: @Robert Engels | Just have the parameters be interfaces and do reflection/type casting. I sadly cannot do this (at least right away). That is why I asked for help. I cannot guarantee the parameters are interfaces - they are what

[go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-11 Thread Alexander Shopov
Hi all, I need some guidance whether what I want to do is somehow possible in Go. I've already searched answers for two days. My problem boils down to how to sneak more in a type without changing the type. Lets say I have to implement the following method: *func (s *server) Get(ctx context.