18 lines
329 B
Go
18 lines
329 B
Go
package tools
|
|
|
|
import (
|
|
"amocrm/internal/proto/socialauth"
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
func DeserializeProtobufMessage(protobufMessage string) (*string, error) {
|
|
msg := socialauth.Message{}
|
|
|
|
err := proto.Unmarshal([]byte(protobufMessage), &msg)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return msg.AccessToken, nil
|
|
}
|