3 Commits

Author SHA1 Message Date
12e4c80d1a fix proto codec
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-09-27 15:50:02 +03:00
github-actions[bot]
5ebe248b19 Merge pull request #50 from unistack-org/dependabot/github_actions/actions/github-script-5
Bump actions/github-script from 4 to 5
2021-09-24 18:20:13 +00:00
dependabot[bot]
e7d372062c Bump actions/github-script from 4 to 5
Bumps [actions/github-script](https://github.com/actions/github-script) from 4 to 5.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-24 18:19:20 +00:00
2 changed files with 14 additions and 13 deletions

View File

@@ -25,7 +25,7 @@ jobs:
|| (github.event.workflow_run.event == 'push' && github.event.workflow_run.pull_requests[0].base.ref == github.event.repository.default_branch ))
steps:
- name: Approve Changes and Merge changes if label 'dependencies' is set
uses: actions/github-script@v4
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |

View File

@@ -38,14 +38,14 @@ func (c *protoCodec) Marshal(v interface{}, opts ...codec.Option) ([]byte, error
return m.Data, nil
}
switch v.(type) {
case proto.Message, newproto.Message:
break
default:
return nil, codec.ErrInvalidMessage
switch m := v.(type) {
case proto.Message:
return proto.Marshal(m)
case newproto.Message:
return proto.Marshal(m)
}
return proto.Marshal(v.(proto.Message))
return nil, codec.ErrInvalidMessage
}
func (c *protoCodec) Unmarshal(d []byte, v interface{}, opts ...codec.Option) error {
@@ -67,14 +67,15 @@ func (c *protoCodec) Unmarshal(d []byte, v interface{}, opts ...codec.Option) er
return nil
}
switch v.(type) {
case proto.Message, newproto.Message:
break
default:
return codec.ErrInvalidMessage
switch m := v.(type) {
case proto.Message:
return proto.Unmarshal(d, m)
case newproto.Message:
return proto.Unmarshal(d, m)
}
return proto.Unmarshal(d, v.(proto.Message))
return codec.ErrInvalidMessage
}
func (c *protoCodec) ReadHeader(conn io.Reader, m *codec.Message, t codec.MessageType) error {