This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// unpopulatedFieldRanger wraps a protoreflect.Message and modifies its Range | |
// method to additionally iterate over unpopulated fields. | |
type unpopulatedFieldRanger struct{ pref.Message } | |
func (m unpopulatedFieldRanger) Range(f func(pref.FieldDescriptor, pref.Value) bool) { | |
fds := m.Descriptor().Fields() | |
for i := 0; i < fds.Len(); i++ { | |
fd := fds.Get(i) | |
if m.Has(fd) || fd.ContainingOneof() != nil { | |
continue // ignore populated fields and fields within a oneofs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Counter { | |
constructor() { | |
this.name = 'Counter'; | |
this.count = 0; | |
} | |
inc() { | |
this.count++; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xconvey | |
import ( | |
"fmt" | |
"testing" | |
// Workaround for ginkgo flags used in CI test commands. Without this import, ginkgo flags are not registered and | |
// the command "go test -v ./... -ginkgo.v" will fail. But for some other reason, ginkgo can not be imported from | |
// both test and non-test packages (error: flag redefined: ginkgo.seed). So test files using this package (xconvey) | |
// must NOT import ginkgo. |
OlderNewer