You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RawResponse.isResourceMarshaled will never be true with this check because the RawResponse.GetDiscoveryResponse method operates on the value of the raw response, not a pointer. Therefore, the RawResponse value in the method is not actually the same that the method is invoked upon (it is a copy).
The program below demonstrates issue number two above:
package main
import (
"fmt"
)
type Structure struct {
Boolean bool
}
func (s Structure) ToggleV() bool {
s.Boolean = !s.Boolean
return s.Boolean
}
func (s *Structure) ToggleP() bool {
s.Boolean = !s.Boolean
return s.Boolean
}
func main() {
value := Structure{}
for i := 0; i < 10; i++ {
fmt.Printf("value: %t\n", value.ToggleV())
}
pointer := &Structure{}
for i := 0; i < 10; i++ {
fmt.Printf("pointer: %t\n", pointer.ToggleP())
}
}
The implementation of caching in #300 is not actually being used. There are the following issues:
RawResponse.marshaledResponse
is never set sonil
should always be returned within this block: https://github.com/envoyproxy/go-control-plane/blob/master/pkg/cache/v2/cache.go#L108. So things should be breaking but aren't because:RawResponse.isResourceMarshaled
will never betrue
with this check because theRawResponse.GetDiscoveryResponse
method operates on the value of the raw response, not a pointer. Therefore, theRawResponse
value in the method is not actually the same that the method is invoked upon (it is a copy).The program below demonstrates issue number two above:
Which outputs:
The text was updated successfully, but these errors were encountered: