moul / protoc-gen-gotemplate

:open_file_folder: generic protocol generator based on golang's text/template (grpc/protobuf)
https://manfred.life/protoc-gen-gotemplate
MIT License
430 stars 70 forks source link

feat: add cppType and cppTypeWithPackage #165

Closed amalone-scwx closed 3 years ago

amalone-scwx commented 3 years ago

This adds helpers for generating C++ types. The primitive types map to those defined in stdint.h. The others map to std::vector and std::string.

Usage example:

{{- range .File.MessageType}}
struct {{ .Name}} {
  {{- range $f := .Field }}
    {{ $f | cppType "" }} {{ .Name | snakeCase}};
  {{- end}}
};
{{ end }}
amalone-scwx commented 3 years ago

Looks like a CI issue ?

[2020-08-27 15:55:35] [build] /bin/sh: 3: golangci-lint: not found
[2020-08-27 15:55:35] [build] make: *** [rules.mk:112: go.lint] Error 127
[2020-08-27 15:55:35] [build] 2020/08/27 15:55:35 Running /usr/bin/make failed, continuing anyway: exit status 2
[2020-08-27 15:55:35] [build] 2020/08/27 15:55:35 Skipping dependency installation because a Go vendor directory was found.
[2020-08-27 15:55:35] [build] 2020/08/27 15:55:35 Running extractor command '/opt/dist/language-packs/go/tools/platform/linux/bin/go-extractor -mod=vendor ./...' from directory '/opt/src'.
[2020-08-27 15:55:35] [build] 2020/08/27 15:55:35 go [-e -json -compiled=true -test=false -export=false -deps=true -find=false -mod=vendor -- ./...]: exit status 1: go: inconsistent vendoring in /opt/src:
github-actions[bot] commented 3 years ago

:tada: This PR is included in version 1.11.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: