Comments (9)
Note: I believe the workaround of just using strings works here, but obviously isn't preferred.
from frugal.
This diff seems to resolve the issue, but I'm not informed enough on thrift/frugal to say whether it would cause any problems elsewhere...
diff --git a/compiler/generator/golang/generator.go b/compiler/generator/golang/generator.go
index 216dafa..d5b82bd 100644
--- a/compiler/generator/golang/generator.go
+++ b/compiler/generator/golang/generator.go
@@ -2152,10 +2152,7 @@ func (g *Generator) isPointerField(field *parser.Field) bool {
hasDefault := field.Default != nil
switch underlyingType.Name {
- case "binary":
- // According to thrift, these are always like this, not sure why
- return false
- case "bool", "byte", "i8", "i16", "i32", "i64", "double", "string":
+ case "bool", "byte", "i8", "i16", "i32", "i64", "double", "string", "binary":
// If there's no default, needs to be a pointer to be nillable
return !hasDefault
case "list", "set", "map":
from frugal.
@justinlindh-wf Thanks for the detailed issue. We will work on adding the patch.
from frugal.
Also, when @benechols-wf and I were testing this, we found compiled our client to use string
fields and had a server using binary
fields and we were able to successfully communicate between each other. Thus the Audit tool should be updated as well to allow binary <-> string type changes w/o raising an error.
from frugal.
@natewoods-wf there could be potential for issues there as string
is encoded as UTF-8 and binary
is an unencoded sequence of bytes.
from frugal.
+1
from frugal.
I also ran into this issue sending a pdf. String type does not work. When trying to open the pdf the conversion to string changes the number of bytes in the pdf. Then when parsing it, the library fails because the PDF streams are the incorrect length.
from frugal.
This appears to be a bug in thrift as well
from frugal.
Addressed in #586.
from frugal.
Related Issues (20)
- used with NATS ? HOT 4
- incompatible some packages? HOT 4
- Frugal Should Error If Generating Files In Conflicting Location
- Allow top-level Frugal objects to be marked as deprecated
- Frugal and Effective Dart Exceptions (for v3.x) HOT 2
- Frugal generates `==` operator incorrectly HOT 1
- Your .dependabot/config.yml contained invalid details HOT 1
- Is there a docker image available at docker hub? HOT 1
- Gen Go code doesn't not compile against latest Thrift go package HOT 1
- Sample code on readme does not compile HOT 1
- Go NATS Middleware HOT 1
- go: failed generating specific variables
- go: failed generating correct code
- `go install` fails when using a fully qualified semver
- Python generates the __hash__ function incorrectly HOT 1
- Audit tool has confusing usage instructions and output HOT 7
- Dart compiler should use `const` rather than `final` HOT 2
- Private dependency on Thrift for Dart HOT 1
- Improvement: intelliJ plugin for frugal support
- Add servlet integration test HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frugal.