Skip to content

Instantly share code, notes, and snippets.

Avatar

Jean-Sebastien Mouret jsmouret

View GitHub Profile
@jsmouret
jsmouret / struct.go
Last active Nov 16, 2021
Convert map[string]interface{} to a google.protobuf.Struct
View struct.go
package pb
import (
"fmt"
"reflect"
st "github.com/golang/protobuf/ptypes/struct"
)
// ToStruct converts a map[string]interface{} to a ptypes.Struct