Joe Tsai
Joe Tsai
Suppose mockgen was run on a source file that specified `proto.Message`. Today, mockgen will generate a file that imports `"github.com/golang/protobuf/proto"`, which is the current place that `proto.Message` is declared. However,...
The NewNames function produces a map of canonical names from a Go struct. It can be passed to Value.NormalizeNames to normalizes case-insensitive matches to a JSON object name to the...
A vast majority of `binary` package usages is only for `BigEndian` and `LittleEndian`. As a breakdown of all `binary` usages: * 75% is for endian-based operations (does not depend on...
The `version` package relies on [finding magic numbers within the Go binary](https://github.com/tailscale/tailscale/blob/45a3de14a603a2909dad1edfca79e5ccb030c8e2/version/cmdname.go#L139-L142) to identify information the region that contains module information. However, this method of identifying module information fails if...
Consider the following proto file: ``` message M { optional string foo = 1; reserved "foo bar"; } ``` Here, `"foo bar"` is clearly an invalid identifier. The intention of...
Using `protoc v3.6.1`. Compile this file: ```proto syntax = "proto3"; message M { string f1 = 1 [json_name = "fooBar"]; string f2 = 2 [json_name = "fooBar"]; } ``` What...
There are often types that are fundamentally opaque wrappers around a scalar type. One such example is `atomic.Bool` and friends. In order to get these types to operate well with...
[Consider the following benchmark](https://go.dev/play/p/H51HzN4tsEl): ```go const prefix = "some sufficiently long prefix " var something = "something" const suffix = " some sufficiently long suffix" var sink []byte func BenchmarkNaive(b...
I'm trying to implement my own map-like data structure. I'm using generics where I have a `comparable` type on hand, but I don't have a way to hash it. To...
Hi, thank you for your work! This might be a short-sighted request, but reflects current production conditions. At present, [the only module in stock](https://www.mouser.com/c/embedded-solutions/?q=edge%20tpu&product%20type=System-On-Modules%20-%20SOM&instock=y) is the single TPU in mini-PCIe...